JRoute :: _() - 函数在哪里?在joomla

时间:2012-03-09 15:46:04

标签: php joomla content-management-system

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

1 个答案:

答案 0 :(得分:5)

您使用的是哪个版本?如果你去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_