3

Why in the class JRoute there is no method with _ , but we use it??, the class JRoute only extends the JObjects, but where are the _ function? in joomla

1 Answer 1

5

What version are you using? If you go to the API page, you have this source code:

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)
        {

So the method is there, defined right from the beginning (line 33 more or less).
Look here for the method's documentation : http://api.joomla.org/Joomla-Platform/JRoute.html#method_

2
  • i am using 1.5 \libraries\joomla\application\router.php - in this path i am searching for that method, but i can't find it Mar 9, 2012 at 16:22
  • 1
    It's in libraries/joomla/methods.php. If you get familiar with the find command (UNIX), you'll find navigating the joomla source a LOT easier; e.g. find /path/to/joomla/ -name '*.php' -exec grep -l '^class JRoute$' {} \;
    – Bobby Jack
    Mar 12, 2012 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.