JController
Base class for a Joomla Controller
Controller (controllers are where you put all the actual code) Provides basic functionality, such as rendering views (aka displaying templates).
Located in /joomla/application/component/controller.php (line 29)
JObject (Subpackage Base)
![]()
JController (Subpackage Application)
object Reference
&getView
([string $name = ''], [string $type = ''], [string $prefix = ''], [array $config = array()])
string
$_acoSection
= null (line 119)
ACO Section for the controller.
string
$_acoSectionValue
= null (line 127)
Default ACO Section value for the controller.
string
$_basePath
= null (line 37)
The base path of the controller
string
$_doTask
= null (line 77)
The mapped task that was performed.
string
$_message
= null (line 103)
Redirect message.
string
$_messageType
= null (line 111)
Redirect message type.
array
$_methods
= null (line 53)
Array of class methods
array
$_name
= null (line 45)
The name of the controller
array
$_path
= array('view' => array()) (line 85)
The set of search directories for resources (views).
string
$_redirect
= null (line 95)
URL for redirection.
string
$_task
= null (line 69)
Current or most recent task to be performed.
array
$_taskMap
= null (line 61)
Array of class methods to call for a given task.
Inherited Variables
Inherited from JObject
JObject::$_errors
Constructor.
- array $config: 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).
- JObject::__construct()
- Class constructor, overridden in descendant classes.
Adds to the stack of model paths in LIFO order.
- string|array $path: The directory (string), or list of directories (array) to add.
Add one or more view paths to the controller's stack, in LIFO order.
- string|array $path: The directory (string), or list of directories (array) to add.
Authorization check
- string $task: The ACO Section Value to check access on
Typical view method for MVC based architecture
This function is provide as a default implementation, in most cases you will need to override it in your own controllers.
- string $cachable: If true, the view output will be cached
Execute a task by triggering a method in the derived class.
- string $task: The task to perform. If no matching task is found, the '__default' task is executed, if defined.
Method to get a model object, loading it if required.
- string $name: The model name. Optional.
- string $prefix: The class prefix. Optional.
- array $config: Configuration array for model. Optional.
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
Method to get a reference to the current view and load it if necessary.
- string $name: The view name. Optional, defaults to the controller name.
- string $type: The view type. Optional.
- string $prefix: The class prefix. Optional.
- array $config: Configuration array for view. Optional.
Redirects the browser or returns false if no redirect is set.
Register the default task to perform if a mapping is not found.
- string $method: The name of the method in the derived class to perform if a named task is not found.
Register (map) a task to a method in the class.
- string $task: The task.
- string $method: The name of the method in the derived class to perform for this task.
Sets the access control levels.
- string $section: The ACO section (eg, the component).
- string $value: The ACO section value (if using a constant value).
Sets the internal message that is passed with a redirect
- string $text: The message
Set a URL for browser redirection.
- string $url: URL to redirect to.
- string $msg: Message to display on redirect. Optional, defaults to value set internally by controller, if any.
- string $type: Message type. Optional, defaults to 'message'.
Adds to the search path for templates and resources.
- string $type: The path type (e.g. 'model', 'view'.
- string|array $path: The directory or stream to search.
Sets an entire array of search paths for resources.
- string $type: The type of path to set, typically 'view' or 'model'.
- string|array $path: The new set of search paths. If null or false, resets to the current directory only.
Inherited Methods
Inherited From JObject
JObject::JObject()
JObject::__construct()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::getPublicProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()





JController (Subpackage Application)
static