Back to RouterBase class

Method __construct

public
__construct
(mixed $app = null, mixed $menu = null)
Class constructor.
Parameters
  • \Joomla\CMS\Application\CMSApplication $app Application-object that the router should use
  • \Joomla\CMS\Menu\AbstractMenu $menu Menu-object that the router should use
Since
  • 3.4
Class: RouterBase
Project: Joomla

Method __construct - Source code

/**
 * 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();
    }
}