Actions

API17

Difference between revisions of "JController"

From Joomla! Documentation

(Updated to r1448:247ba8d88526)
m (moving preparation)
 
(3 intermediate revisions by one user not shown)
Line 14: Line 14:
 
|-
 
|-
 
|public  
 
|public  
|[[JController::__construct/11.1|__construct]]
+
|[[API17:JController::__construct|__construct]]
 
|Constructor.  
 
|Constructor.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::addViewPath/11.1|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/11.1|authorise]]
+
|[[API17:JController::authorise|authorise]]
 
|Authorisation check.  
 
|Authorisation check.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::authorize/11.1|authorize]]
+
|[[API17:JController::authorize|authorize]]
 
|Authorisation check.  
 
|Authorisation check.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::display/11.1|display]]
+
|[[API17:JController::display|display]]
 
|Typical view method for MVC based architecture.  
 
|Typical view method for MVC based architecture.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::execute/11.1|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/11.1|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/11.1|getName]]
+
|[[API17:JController::getName|getName]]
 
|Method to get the controller name.  
 
|Method to get the controller name.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::getTask/11.1|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/11.1|getTasks]]
+
|[[API17:JController::getTasks|getTasks]]
 
|Gets the available tasks in the controller.  
 
|Gets the available tasks in the controller.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::getView/11.1|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/11.1|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/11.1|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/11.1|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/11.1|setAccessControl]]
+
|[[API17:JController::setAccessControl|setAccessControl]]
 
|Sets the access control levels.  
 
|Sets the access control levels.  
 
|-
 
|-
 
|public  
 
|public  
|[[JController::setMessage/11.1|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/11.1|setRedirect]]
+
|[[API17:JController::setRedirect|setRedirect]]
 
|Set a URL for browser redirection.  
 
|Set a URL for browser redirection.  
 
|-
 
|-
 
|public static  
 
|public static  
|[[JController::addModelPath/11.1|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/11.1|getInstance]]
+
|[[API17:JController::getInstance|getInstance]]
 
|Method to get a singleton controller instance.  
 
|Method to get a singleton controller instance.  
 
|-
 
|-
 
|protected  
 
|protected  
|[[JController::addPath/11.1|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/11.1|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/11.1|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/11.1|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/11.1|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/11.1|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/11.1|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/11.1|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/11.1|JObject]]
+
* '''Extends''' [[API17:JObject|JObject]]
 
* '''Extended by'''
 
* '''Extended by'''
** [[JControllerAdmin/11.1|JControllerAdmin]]
+
** [[API17:JControllerAdmin|JControllerAdmin]]
** [[JControllerForm/11.1|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/11.1|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%;">
Line 148: Line 148:
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JController]]</noinclude>
+
<noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude>

Latest revision as of 18:57, 11 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Joomla 11.1 JController

Description

JController is an abstract class which provides the basic functionality for your own Controller classes which your create for your components. The Controller is part of Joomla's MVC Pattern. Learn how to develop a component using MVC

The Joomla MVC Design Pattern

Model-View-Controller (MVC) is a set of design patterns, that are used to separate the different layers of your application.

  • The View displays the data of the model by passing it to a template. The view object can therefore access the data of the model. Joomla implements the basic functionality in the abstract JView class.
  • The Model stores the data of the application, and contains the business logic. Joomla implements the basic functionality in the abstract JModel class.
  • The Controller handles the user requests and evokes the model and the views to change it's state. Joomla implements the basic functionality in the JController class.

[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.

Importing

jimport( 'joomla.application.component.controller' );

See also

SeeAlso:JController [Edit See Also]

User contributed notes

<CodeExamplesForm />