Difference between revisions of "JController"
From Joomla! Documentation
(Layout updates) |
m (moving preparation) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
+ | =={{JVer|11.1}} JController== | ||
+ | ===Description=== | ||
+ | {{Description:JController}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[Description:JController|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JController|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
+ | !Visibility | ||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
− | |[[JController::__construct | + | |public |
+ | |[[API17:JController::__construct|__construct]] | ||
|Constructor. | |Constructor. | ||
|- | |- | ||
− | |[[JController::addViewPath | + | |public |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::authorise | + | |public |
+ | |[[API17:JController::authorise|authorise]] | ||
|Authorisation check. | |Authorisation check. | ||
|- | |- | ||
− | |[[JController::authorize | + | |public |
+ | |[[API17:JController::authorize|authorize]] | ||
|Authorisation check. | |Authorisation check. | ||
|- | |- | ||
− | |[[JController::display | + | |public |
+ | |[[API17:JController::display|display]] | ||
|Typical view method for MVC based architecture. | |Typical view method for MVC based architecture. | ||
|- | |- | ||
− | |[[JController::execute | + | |public |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::getModel | + | |public |
+ | |[[API17:JController::getModel|getModel]] | ||
|Method to get a model object, loading it if required. | |Method to get a model object, loading it if required. | ||
|- | |- | ||
− | |[[JController::getName | + | |public |
+ | |[[API17:JController::getName|getName]] | ||
|Method to get the controller name. | |Method to get the controller name. | ||
|- | |- | ||
− | |[[JController::getTask | + | |public |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::getTasks | + | |public |
+ | |[[API17:JController::getTasks|getTasks]] | ||
|Gets the available tasks in the controller. | |Gets the available tasks in the controller. | ||
|- | |- | ||
− | |[[JController::getView | + | |public |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::redirect | + | |public |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::registerDefaultTask | + | |public |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::registerTask | + | |public |
+ | |[[API17:JController::registerTask|registerTask]] | ||
|Register (map) a task to a method in the class. | |Register (map) a task to a method in the class. | ||
|- | |- | ||
− | |[[JController::setAccessControl | + | |public |
+ | |[[API17:JController::setAccessControl|setAccessControl]] | ||
|Sets the access control levels. | |Sets the access control levels. | ||
|- | |- | ||
− | |[[JController::setMessage | + | |public |
+ | |[[API17:JController::setMessage|setMessage]] | ||
|Sets the internal message that is passed with a redirect. | |Sets the internal message that is passed with a redirect. | ||
|- | |- | ||
− | |[[JController::setRedirect | + | |public |
+ | |[[API17:JController::setRedirect|setRedirect]] | ||
|Set a URL for browser redirection. | |Set a URL for browser redirection. | ||
|- | |- | ||
− | |[[JController::addModelPath | + | |public static |
+ | |[[API17:JController::addModelPath|addModelPath]] | ||
|Adds to the stack of model paths in LIFO order. | |Adds to the stack of model paths in LIFO order. | ||
|- | |- | ||
− | |[[JController::getInstance | + | |public static |
+ | |[[API17:JController::getInstance|getInstance]] | ||
|Method to get a singleton controller instance. | |Method to get a singleton controller instance. | ||
|- | |- | ||
− | |[[JController::addPath | + | |protected |
+ | |[[API17:JController::addPath|addPath]] | ||
|Adds to the search path for templates and resources. | |Adds to the search path for templates and resources. | ||
|- | |- | ||
− | |[[JController::checkEditId | + | |protected |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::createModel | + | |protected |
+ | |[[API17:JController::createModel|createModel]] | ||
|Method to load and return a model object. | |Method to load and return a model object. | ||
|- | |- | ||
− | |[[JController::createView | + | |protected |
+ | |[[API17:JController::createView|createView]] | ||
|Method to load and return a view object. | |Method to load and return a view object. | ||
|- | |- | ||
− | |[[JController::holdEditId | + | |protected |
+ | |[[API17:JController::holdEditId|holdEditId]] | ||
|Method to add a record ID to the edit list. | |Method to add a record ID to the edit list. | ||
|- | |- | ||
− | |[[JController::releaseEditId | + | |protected |
+ | |[[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. | ||
|- | |- | ||
− | |[[JController::setPath | + | |protected |
+ | |[[API17:JController::setPath|setPath]] | ||
|Sets an entire array of search paths for resources. | |Sets an entire array of search paths for resources. | ||
|- | |- | ||
− | |[[JController::createFileName | + | |protected static |
+ | |[[API17:JController::createFileName|createFileName]] | ||
|Create the filename for a resource. | |Create the filename for a resource. | ||
|- | |- | ||
|} | |} | ||
+ | * '''Defined in''' libraries/joomla/application/component/controller.php | ||
+ | * '''Extends''' [[API17:JObject|JObject]] | ||
+ | * '''Extended by''' | ||
+ | ** [[API17:JControllerAdmin|JControllerAdmin]] | ||
+ | ** [[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=== | ||
− | * JController source code | + | * {{JVer|11.1}} '''JController source code''' on [[jplatform:application/component/controller.php|BitBucket]] |
− | * [[JController|Other versions of | + | * {{JVer|11.1}} Subpackage [[API17:Subpackage Application|Application]] |
+ | * [[API17:JController|Other versions of JController]] | ||
{{SeeAlso:JController}} | {{SeeAlso:JController}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[SeeAlso:JController|Edit See Also]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[SeeAlso:JController|Edit See Also]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
− | === | + | ===User contributed notes=== |
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
Line 119: | Line 145: | ||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
+ | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
− | <noinclude> | + | <noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude> |
Revision as of 19:57, 11 May 2013
The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
JController[edit]
Description[edit]
Template:Description:JController [Edit Descripton]
Methods[edit]
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[edit]
jimport( 'joomla.application.component.controller' );
See also[edit]
- JController source code on BitBucket
- Subpackage Application
- Other versions of JController
Template:SeeAlso:JController [Edit See Also]
User contributed notes[edit]
<CodeExamplesForm />