|
|
| (16 intermediate revisions by 3 users not shown) |
| Line 1: |
Line 1: |
| − | == Overview ==
| + | This class is available in the following Joomla versions:- |
| − | The base class used to control Joomla! components.
| + | <splist showpath=notparent /> |
| − | | + | <noinclude>[[Category:Platform JClasses]][[Category:JController]]</noinclude> |
| − | | + | |
| − | == Properties ==
| + | |
| − | '''_acoSection''' - protected string<br />
| + | |
| − | ACO Section for the controller.
| + | |
| − | | + | |
| − | '''_acoSectionValue''' - protected string<br />
| + | |
| − | Default ACO Section value for the controller.
| + | |
| − | | + | |
| − | '''_basePath''' - protected string<br />
| + | |
| − | The base path of the controller.
| + | |
| − | | + | |
| − | '''_doTask''' - protected string<br />
| + | |
| − | The mapped task that was performed.
| + | |
| − | | + | |
| − | '''_message''' - protected string<br />
| + | |
| − | Redirect message.
| + | |
| − | | + | |
| − | '''_messageType''' - protected string<br />
| + | |
| − | Redirect message type.
| + | |
| − | | + | |
| − | '''_methods''' - protected array<br />
| + | |
| − | Array of class methods.
| + | |
| − | | + | |
| − | '''_name''' - protected array<br />
| + | |
| − | The name of the controller.
| + | |
| − | | + | |
| − | '''_path''' - protected array<br />
| + | |
| − | The set of search directories for resources (views).
| + | |
| − | | + | |
| − | '''_redirect''' - protected string<br />
| + | |
| − | URL for redirection.
| + | |
| − | | + | |
| − | '''_task''' - protected string<br />
| + | |
| − | Current or most recent task to be performed.
| + | |
| − | | + | |
| − | '''_taskMap''' - protected array<br />
| + | |
| − | Array of class methods to call for a given task.
| + | |
| − | <br /><br />
| + | |
| − | | + | |
| − | == Methods ==
| + | |
| − | '''__construct'''( $config = array() ) - protected<br />
| + | |
| − | Description: Constructor for the JController class.<br />
| + | |
| − | Parameters:<br />
| + | |
| − | * $config (array) 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).<br />
| + | |
| − | Return value: none.
| + | |
| − | | + | |
| − | | + | |
| − | '''addModelPath'''( $path ) - static<br />
| + | |
| − | Description: Adds to the stack of model paths in LIFO order.<br />
| + | |
| − | Parameters:<br />
| + | |
| − | * $path (string|array) The directory (string), or list of directories (array) to add.
| + | |
| − | Return value: none.
| + | |
| − | | + | |
| − | | + | |
| − | '''authorize'''( $task ) - public<br />
| + | |
| − | Description: Authorization check.<br />
| + | |
| − | Parameters:<br />
| + | |
| − | * $task (string) The ACO Section Value to check access on.
| + | |
| − | Return value: (boolean) True if authorized.
| + | |
| − | | + | |
| − | | + | |
| − | '''display'''( $cachable=false ) - public<br />
| + | |
| − | Description: Typical view method for MVC based architecture. This function is provided as a default implementation, in most cases you will need to override it in your own controllers.<br />
| + | |
| − | Parameters:<br />
| + | |
| − | * $cachable (string) If true, the view output will be cached.
| + | |
| − | Return value: none.
| + | |
| − | | + | |
| − | | + | |
| − | '''execute'''( $task ) - public<br />
| + | |
| − | Description: Execute a task by triggering a method in the derived class.<br />
| + | |
| − | Parameters:<br />
| + | |
| − | * $task (string) The task to perform. If no matching task is found, the '__default' task is executed, if defined.<br />
| + | |
| − | Return value: (mixed/false) The value returned by the called method, false in error case.
| + | |
| − | | + | |
| − | | + | |
| − | '''&getModel'''( $name = '', $prefix = '', $config = array() ) - public<br />
| + | |
| − | Description: Method to get a model object, loading it if required.<br />
| + | |
| − | Parameters:<br />
| + | |
| − | * $name (string) The model name. Optional.
| + | |
| − | * $prefix (string) The class prefix. Optional.
| + | |
| − | * $config (array) Configuration array for model. Optional.
| + | |
| − | Return value: (object) The model.
| + | |
| − | | + | |
| − | | + | |
| − | '''getName'''() - public<br />
| + | |
| − | Description: Method to get the controller name. The dispatcher name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor.<br />
| + | |
| − | Return value: (string) The name of the dispatcher.
| + | |
| − | | + | |
| − | | + | |
| − | '''getTask'''() - public<br />
| + | |
| − | Description: Get the last task that is or was to be performed.<br />
| + | |
| − | Return value: (string) The task that was or is being performed.
| + | |
| − | | + | |
| − | | + | |
| − | '''getTasks'''() - public<br />
| + | |
| − | Description: Gets the available tasks in the controller.<br />
| + | |
| − | Return value: array Array[i] of task names.
| + | |
| − | | + | |
| − | | + | |
| − | '''redirect'''() - public<br />
| + | |
| − | Description: Redirects the browser or returns false if no redirect is set.<br />
| + | |
| − | Return value: (boolean) False if no redirect exists.
| + | |
| − | | + | |
| − | <br />
| + | |
| − | <br /> | + | |