Back to BaseApplication class

Method __construct

public
__construct
(\Joomla\CMS\Input\Input $input = null, \Joomla\Registry\Registry $config = null)
Class constructor.
Parameters
  • \Joomla\CMS\Input\Input $input An optional argument to provide dependency injection for the application's input object. If the argument is a \JInput object that object will become the application's input object, otherwise a default input object is created.
  • \Joomla\Registry\Registry $config An optional argument to provide dependency injection for the application's config object. If the argument is a Registry object that object will become the application's config object, otherwise a default config object is created.
Since
  • 3.0.0

Method __construct - Source code

/**
 * Class constructor.
 *
 * @param   Input     $input   An optional argument to provide dependency injection for the application's
 *                             input object.  If the argument is a \JInput object that object will become
 *                             the application's input object, otherwise a default input object is created.
 * @param   Registry  $config  An optional argument to provide dependency injection for the application's
 *                             config object.  If the argument is a Registry object that object will become
 *                             the application's config object, otherwise a default config object is created.
 *
 * @since   3.0.0
 */
public function __construct(Input $input = null, Registry $config = null)
{
    $this->input = $input instanceof Input ? $input : new Input();
    $this->config = $config instanceof Registry ? $config : new Registry();
    $this->initialise();
}