Table of Contents

__construct

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JController Method __construct Reference __construct() Never Work in Progress

The class constructor performs the necessary tasks to instantiate the controller.

This involves the following steps:

Syntax

JController __construct ( $config )

$config array is an optional associative array of configuration settings. Recognized key values include ‘name’, ‘default_task’, ‘model_path’, and ‘view_path’ (this list is not meant to be comprehensive).

Examples

A controller is often instantiated in the component entry point (the admin.component.php or component.php file, where component is the name of the component). This might be done in the following way:

Example

$controller = new BannersController( array('default_task' => 'click') );