<i id='7ocvf'><tr id='7ocvf'><dt id='7ocvf'><q id='7ocvf'><span id='7ocvf'><b id='7ocvf'><form id='7ocvf'><ins id='7ocvf'></ins><ul id='7ocvf'></ul><sub id='7ocvf'></sub></form><legend id='7ocvf'></legend><bdo id='7ocvf'><pre id='7ocvf'><center id='7ocvf'></center></pre></bdo></b><th id='7ocvf'></th></span></q></dt></tr></i><div id='7ocvf'><tfoot id='7ocvf'></tfoot><dl id='7ocvf'><fieldset id='7ocvf'></fieldset></dl></div>

    1. <legend id='7ocvf'><style id='7ocvf'><dir id='7ocvf'><q id='7ocvf'></q></dir></style></legend>
      <tfoot id='7ocvf'></tfoot>

        • <bdo id='7ocvf'></bdo><ul id='7ocvf'></ul>

        <small id='7ocvf'></small><noframes id='7ocvf'>

      1. Joomla 获取页面 ID

        时间:2023-10-16
      2. <i id='OFny2'><tr id='OFny2'><dt id='OFny2'><q id='OFny2'><span id='OFny2'><b id='OFny2'><form id='OFny2'><ins id='OFny2'></ins><ul id='OFny2'></ul><sub id='OFny2'></sub></form><legend id='OFny2'></legend><bdo id='OFny2'><pre id='OFny2'><center id='OFny2'></center></pre></bdo></b><th id='OFny2'></th></span></q></dt></tr></i><div id='OFny2'><tfoot id='OFny2'></tfoot><dl id='OFny2'><fieldset id='OFny2'></fieldset></dl></div>

          • <small id='OFny2'></small><noframes id='OFny2'>

              1. <legend id='OFny2'><style id='OFny2'><dir id='OFny2'><q id='OFny2'></q></dir></style></legend>

                <tfoot id='OFny2'></tfoot>
                  <bdo id='OFny2'></bdo><ul id='OFny2'></ul>
                    <tbody id='OFny2'></tbody>
                • 本文介绍了Joomla 获取页面 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试从 Joomla 2.5.14 获取当前的 page_id、user_id 和日期.这是我正在使用的代码:

                  I'm trying to get the current page_id, user_id and date from a Joomla 2.5.14. This is the code I'm using:

                  <?php
                  $foo = $jinput->get('id');
                  echo $foo;
                  
                  
                  $user =& JFactory::getUser();
                  $usr_id = $user->get('id');
                  echo $usr_id;
                  
                  $date =& JFactory::getDate();
                  echo 'Current date and time is: ' . $date->toFormat() . "
                  ";
                  
                  ?>
                  

                  JFactory 工作正常(我获取当前用户和日期)但 jinput 出现错误:

                  JFactory is working ok (I get the current user and date) but jinput is giving the error:

                  Notice: Undefined variable: jinput in`
                  

                  推荐答案

                  你忘记定义$jinput:

                  <?php
                  $jinput = JFactory::getApplication()->input;
                  
                  $foo = $jinput->get('id');
                  echo $foo;
                  
                  $user = JFactory::getUser();
                  $usr_id = $user->get('id');
                  echo $usr_id;
                  
                  $date = JFactory::getDate();
                  echo 'Current date and time is: ' . $date->toFormat() . "
                  ";
                  
                  ?>
                  

                  附带说明,您不需要使用 &.

                  On a side note, you don't need to use &.

                  希望能帮到你

                  这篇关于Joomla 获取页面 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 php 中访问 joomla 会话 - codeigniter 下一篇:Joomla - 管理面板中的动态下拉列表

                  相关文章

                  1. <i id='VALPS'><tr id='VALPS'><dt id='VALPS'><q id='VALPS'><span id='VALPS'><b id='VALPS'><form id='VALPS'><ins id='VALPS'></ins><ul id='VALPS'></ul><sub id='VALPS'></sub></form><legend id='VALPS'></legend><bdo id='VALPS'><pre id='VALPS'><center id='VALPS'></center></pre></bdo></b><th id='VALPS'></th></span></q></dt></tr></i><div id='VALPS'><tfoot id='VALPS'></tfoot><dl id='VALPS'><fieldset id='VALPS'></fieldset></dl></div>
                      • <bdo id='VALPS'></bdo><ul id='VALPS'></ul>

                    1. <small id='VALPS'></small><noframes id='VALPS'>

                      <legend id='VALPS'><style id='VALPS'><dir id='VALPS'><q id='VALPS'></q></dir></style></legend><tfoot id='VALPS'></tfoot>