Support Joomla!

references:joomla.framework:application:jcontroller-__construct

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:

  • initialize private variables
  • determine the methods to be mapped to tasks by detecting which methods do not exist in the base JController class
  • register the default task
  • set the default model search path
  • set the default view search path

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') );

 
references/joomla.framework/application/jcontroller-__construct.txt (384 views) · Last modified: 2007/08/15 14:49