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

yea*_* me 3 php joomla content-management-system

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

Dam*_*rsy 5

你用的是什么版本?如果你转到API页面,你有这个源代码:

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)
        {
Run Code Online (Sandbox Code Playgroud)

所以方法是从那里开始定义的(第33行或多或少).
在这里查看方法的文档:http://api.joomla.org/Joomla-Platform/JRoute.html#method_