Back to ComponentDispatcher class

Method __construct

public
__construct
(\Joomla\CMS\Application\CMSApplicationInterface $app, \Joomla\Input\Input $input, \Joomla\CMS\MVC\Factory\MVCFactoryInterface $mvcFactory)
Constructor for ComponentDispatcher
Parameters
  • \Joomla\CMS\Application\CMSApplicationInterface $app The application instance
  • \Joomla\Input\Input $input The input instance
  • \Joomla\CMS\MVC\Factory\MVCFactoryInterface $mvcFactory The MVC factory instance
Since
  • 4.0.0

Method __construct - Source code

/**
 * Constructor for ComponentDispatcher
 *
 * @param   CMSApplicationInterface  $app         The application instance
 * @param   Input                    $input       The input instance
 * @param   MVCFactoryInterface      $mvcFactory  The MVC factory instance
 *
 * @since   4.0.0
 */
public function __construct(CMSApplicationInterface $app, Input $input, MVCFactoryInterface $mvcFactory)
{
    parent::__construct($app, $input);
    $this->mvcFactory = $mvcFactory;
    // If option is not provided, detect it from dispatcher class name, ie ContentDispatcher
    if (empty($this->option)) {
        $this->option = ComponentHelper::getComponentName($this, str_replace('com_', '', $input->get('option')));
    }
    $this->loadLanguage();
}