【问题标题】:Where are the JRoute::_() - function? in joomlaJRoute::_() - 函数在哪里?在 joomla
【发布时间】:2012-03-09 15:46:03
【问题描述】:

为什么在JRoute类中没有带_的方法,但我们使用它??,JRoute类只扩展了JObjects,但是_函数在哪里?在joomla中

【问题讨论】:

    标签: php joomla content-management-system


    【解决方案1】:

    你用的是什么版本?如果你去to the API page,你有这个源代码:

    class JRoute
    {
        /**
         * Translates an internal Joomla URL to a humanly readible URL.
         *
         * @param   string   $url    Absolute or Relative URI to Joomla resource.
         * @param   boolean  $xhtml  Replace & by & for XML compilance.
         * @param   integer  $ssl    Secure state for the resolved URI.
         *                              1: Make URI secure using global secure site URI.
         *                              0: Leave URI in the same secure state as it was passed to the function.
         *                             -1: Make URI unsecure using the global unsecure site URI.
         *
         * @return  The translated humanly readible URL.
         *
         * @since   11.1
         */
        public static function _($url, $xhtml = true, $ssl = null)
        {
            // Get the router.
            $app = JFactory::getApplication();
            $router = $app->getRouter();
    
            // Make sure that we have our router
            if (!$router)
            {
    

    所以方法就在那里,从一开始就定义了(或多或少的第 33 行)。
    在此处查找该方法的文档:http://api.joomla.org/Joomla-Platform/JRoute.html#method_

    【讨论】:

    • 我正在使用 1.5 \libraries\joomla\application\router.php - 在这条路径中我正在搜索该方法,但我找不到它
    • 它在libraries/joomla/methods.php。如果您熟悉 find 命令 (UNIX),您会发现浏览 joomla 源代码要容易得多;例如find /path/to/joomla/ -name '*.php' -exec grep -l '^class JRoute$' {} \;
    猜你喜欢
    • 2011-10-08
    • 2023-01-29
    • 2017-05-28
    • 2012-04-20
    • 1970-01-01
    • 2013-09-10
    • 1970-01-01
    • 2014-08-31
    • 1970-01-01
    相关资源
    最近更新 更多