JController: Difference between revisions
From Joomla! Documentation
m →User contributed notes: moving preparation |
m moving preparation |
||
| Line 14: | Line 14: | ||
|- | |- | ||
|public | |public | ||
|[[JController::__construct | |[[API17:JController::__construct|__construct]] | ||
|Constructor. | |Constructor. | ||
|- | |- | ||
|public | |public | ||
|[[JController::addViewPath | |[[API17:JController::addViewPath|addViewPath]] | ||
|Add one or more view paths to the controller's stack, in LIFO order. | |Add one or more view paths to the controller's stack, in LIFO order. | ||
|- | |- | ||
|public | |public | ||
|[[JController::authorise | |[[API17:JController::authorise|authorise]] | ||
|Authorisation check. | |Authorisation check. | ||
|- | |- | ||
|public | |public | ||
|[[JController::authorize | |[[API17:JController::authorize|authorize]] | ||
|Authorisation check. | |Authorisation check. | ||
|- | |- | ||
|public | |public | ||
|[[JController::display | |[[API17:JController::display|display]] | ||
|Typical view method for MVC based architecture. | |Typical view method for MVC based architecture. | ||
|- | |- | ||
|public | |public | ||
|[[JController::execute | |[[API17:JController::execute|execute]] | ||
|Execute a task by triggering a method in the derived class. | |Execute a task by triggering a method in the derived class. | ||
|- | |- | ||
|public | |public | ||
|[[JController::getModel | |[[API17:JController::getModel|getModel]] | ||
|Method to get a model object, loading it if required. | |Method to get a model object, loading it if required. | ||
|- | |- | ||
|public | |public | ||
|[[JController::getName | |[[API17:JController::getName|getName]] | ||
|Method to get the controller name. | |Method to get the controller name. | ||
|- | |- | ||
|public | |public | ||
|[[JController::getTask | |[[API17:JController::getTask|getTask]] | ||
|Get the last task that is being performed or was most recently performed. | |Get the last task that is being performed or was most recently performed. | ||
|- | |- | ||
|public | |public | ||
|[[JController::getTasks | |[[API17:JController::getTasks|getTasks]] | ||
|Gets the available tasks in the controller. | |Gets the available tasks in the controller. | ||
|- | |- | ||
|public | |public | ||
|[[JController::getView | |[[API17:JController::getView|getView]] | ||
|Method to get a reference to the current view and load it if necessary. | |Method to get a reference to the current view and load it if necessary. | ||
|- | |- | ||
|public | |public | ||
|[[JController::redirect | |[[API17:JController::redirect|redirect]] | ||
|Redirects the browser or returns false if no redirect is set. | |Redirects the browser or returns false if no redirect is set. | ||
|- | |- | ||
|public | |public | ||
|[[JController::registerDefaultTask | |[[API17:JController::registerDefaultTask|registerDefaultTask]] | ||
|Register the default task to perform if a mapping is not found. | |Register the default task to perform if a mapping is not found. | ||
|- | |- | ||
|public | |public | ||
|[[JController::registerTask | |[[API17:JController::registerTask|registerTask]] | ||
|Register (map) a task to a method in the class. | |Register (map) a task to a method in the class. | ||
|- | |- | ||
|public | |public | ||
|[[JController::setAccessControl | |[[API17:JController::setAccessControl|setAccessControl]] | ||
|Sets the access control levels. | |Sets the access control levels. | ||
|- | |- | ||
|public | |public | ||
|[[JController::setMessage | |[[API17:JController::setMessage|setMessage]] | ||
|Sets the internal message that is passed with a redirect. | |Sets the internal message that is passed with a redirect. | ||
|- | |- | ||
|public | |public | ||
|[[JController::setRedirect | |[[API17:JController::setRedirect|setRedirect]] | ||
|Set a URL for browser redirection. | |Set a URL for browser redirection. | ||
|- | |- | ||
|public static | |public static | ||
|[[JController::addModelPath | |[[API17:JController::addModelPath|addModelPath]] | ||
|Adds to the stack of model paths in LIFO order. | |Adds to the stack of model paths in LIFO order. | ||
|- | |- | ||
|public static | |public static | ||
|[[JController::getInstance | |[[API17:JController::getInstance|getInstance]] | ||
|Method to get a singleton controller instance. | |Method to get a singleton controller instance. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::addPath | |[[API17:JController::addPath|addPath]] | ||
|Adds to the search path for templates and resources. | |Adds to the search path for templates and resources. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::checkEditId | |[[API17:JController::checkEditId|checkEditId]] | ||
|Method to check whether an ID is in the edit list. | |Method to check whether an ID is in the edit list. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::createModel | |[[API17:JController::createModel|createModel]] | ||
|Method to load and return a model object. | |Method to load and return a model object. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::createView | |[[API17:JController::createView|createView]] | ||
|Method to load and return a view object. | |Method to load and return a view object. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::holdEditId | |[[API17:JController::holdEditId|holdEditId]] | ||
|Method to add a record ID to the edit list. | |Method to add a record ID to the edit list. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::releaseEditId | |[[API17:JController::releaseEditId|releaseEditId]] | ||
|Method to check whether an ID is in the edit list. | |Method to check whether an ID is in the edit list. | ||
|- | |- | ||
|protected | |protected | ||
|[[JController::setPath | |[[API17:JController::setPath|setPath]] | ||
|Sets an entire array of search paths for resources. | |Sets an entire array of search paths for resources. | ||
|- | |- | ||
|protected static | |protected static | ||
|[[JController::createFileName | |[[API17:JController::createFileName|createFileName]] | ||
|Create the filename for a resource. | |Create the filename for a resource. | ||
|- | |- | ||
|} | |} | ||
* '''Defined in''' libraries/joomla/application/component/controller.php | * '''Defined in''' libraries/joomla/application/component/controller.php | ||
* '''Extends''' [[JObject | * '''Extends''' [[API17:JObject|JObject]] | ||
* '''Extended by''' | * '''Extended by''' | ||
** [[JControllerAdmin | ** [[API17:JControllerAdmin|JControllerAdmin]] | ||
** [[JControllerForm | ** [[API17:JControllerForm|JControllerForm]] | ||
===Importing=== | ===Importing=== | ||
<source lang="php">jimport( 'joomla.application.component.controller' );</source> | <source lang="php">jimport( 'joomla.application.component.controller' );</source> | ||
===See also=== | ===See also=== | ||
* {{JVer|11.1}} '''JController source code''' on [[jplatform:application/component/controller.php|BitBucket]] | * {{JVer|11.1}} '''JController source code''' on [[jplatform:application/component/controller.php|BitBucket]] | ||
* {{JVer|11.1}} Subpackage [[Subpackage Application | * {{JVer|11.1}} Subpackage [[API17:Subpackage Application|Application]] | ||
* [[JController|Other versions of JController]] | * [[API17:JController|Other versions of JController]] | ||
{{SeeAlso:JController}} | {{SeeAlso:JController}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
Revision as of 00:57, 12 May 2013
JController
Description
Template:Description:JController [Edit Descripton]
Methods
| Visibility | Method name | Description |
|---|---|---|
| public | __construct | Constructor. |
| public | addViewPath | Add one or more view paths to the controller's stack, in LIFO order. |
| public | authorise | Authorisation check. |
| public | authorize | Authorisation check. |
| public | display | Typical view method for MVC based architecture. |
| public | execute | Execute a task by triggering a method in the derived class. |
| public | getModel | Method to get a model object, loading it if required. |
| public | getName | Method to get the controller name. |
| public | getTask | Get the last task that is being performed or was most recently performed. |
| public | getTasks | Gets the available tasks in the controller. |
| public | getView | Method to get a reference to the current view and load it if necessary. |
| public | redirect | Redirects the browser or returns false if no redirect is set. |
| public | registerDefaultTask | Register the default task to perform if a mapping is not found. |
| public | registerTask | Register (map) a task to a method in the class. |
| public | setAccessControl | Sets the access control levels. |
| public | setMessage | Sets the internal message that is passed with a redirect. |
| public | setRedirect | Set a URL for browser redirection. |
| public static | addModelPath | Adds to the stack of model paths in LIFO order. |
| public static | getInstance | Method to get a singleton controller instance. |
| protected | addPath | Adds to the search path for templates and resources. |
| protected | checkEditId | Method to check whether an ID is in the edit list. |
| protected | createModel | Method to load and return a model object. |
| protected | createView | Method to load and return a view object. |
| protected | holdEditId | Method to add a record ID to the edit list. |
| protected | releaseEditId | Method to check whether an ID is in the edit list. |
| protected | setPath | Sets an entire array of search paths for resources. |
| protected static | createFileName | Create the filename for a resource. |
- Defined in libraries/joomla/application/component/controller.php
- Extends JObject
- Extended by
Importing
jimport( 'joomla.application.component.controller' );
See also
JController source code on BitBucket
Subpackage Application- Other versions of JController
Template:SeeAlso:JController [Edit See Also]
User contributed notes
<CodeExamplesForm />