CoreFiles by mySites.guru
RouterBase.php73 lines, 1,638 bytes, from Joomla_4.2.0-Stable-Full_Package.zip
Raw History Compare with 4.1.5
md5
f61e37d44cd838ff98ef16338679d4e8
sha1
f1c4feb0954ea0dd58e583febd5e00b38065ce7d
sha256
c295135a893b4b218739a44f8dee5c8c1798a60b64aa7da29aeb63755793280d
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Component\Router;

use Joomla\CMS\Factory;

/**
 * Base component routing class
 *
 * @since  3.3
 */
abstract class RouterBase implements RouterInterface
{
    /**
     * Application object to use in the router
     *
     * @var    \Joomla\CMS\Application\CMSApplication
     * @since  3.4
     */
    public $app;

    /**
     * Menu object to use in the router
     *
     * @var    \Joomla\CMS\Menu\AbstractMenu
     * @since  3.4
     */
    public $menu;

    /**
     * Class constructor.
     *
     * @param   \Joomla\CMS\Application\CMSApplication  $app   Application-object that the router should use
     * @param   \Joomla\CMS\Menu\AbstractMenu           $menu  Menu-object that the router should use
     *
     * @since   3.4
     */
    public function __construct($app = null, $menu = null)
    {
        if ($app) {
            $this->app = $app;
        } else {
            $this->app = Factory::getApplication();
        }

        if ($menu) {
            $this->menu = $menu;
        } else {
            $this->menu = $this->app->getMenu();
        }
    }

    /**
     * Generic method to preprocess a URL
     *
     * @param   array  $query  An associative array of URL arguments
     *
     * @return  array  The URL arguments to use to assemble the subsequent URL.
     *
     * @since   3.3
     */
    public function preprocess($query)
    {
        return $query;
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.