<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

        Joomla Get Page Id(Joomla 获取页面 ID)
      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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Joomla 2.5 much faster than Joomla 1.5 Querywise(Joomla 2.5 比 Joomla 1.5 Querywise 快得多吗)
                  How to share Joomla login session from one joomla website to one ASP.Net MVC website(如何将 Joomla 登录会话从一个 joomla 网站共享到一个 ASP.Net MVC 网站)
                  htaccess redirect root to subdirectory but allow index.php in root AND query strings to function(htaccess 将根重定向到子目录,但允许根和查询字符串中的 index.php 起作用)
                  Joomla include database functions(Joomla 包含数据库功能)
                  nl2br() not working when displaying SQL results(显示 SQL 结果时 nl2br() 不起作用)
                  Joomla 2.5 JFactory::getSession(); seems to be caching in firefox(Joomla 2.5 JFactory::getSession();似乎在 Firefox 中缓存)

                      <tbody id='VALPS'></tbody>
                    <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>

                          • <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>