JController/1.5

From Joomla! Documentation
< JController(Difference between revisions)
Jump to: navigation, search
(Layout updates)
m (See also: fixing link to API)
 
Line 107: Line 107:
 
<source lang="php">jimport( 'joomla.application.component.controller' );</source>
 
<source lang="php">jimport( 'joomla.application.component.controller' );</source>
 
===See also===
 
===See also===
* {{JVer|1.5}} '''JController''' on [http://api.joomla.org/Joomla-Framework/Application/JController.html api.joomla.org]
+
* {{JVer|1.5}} '''JController''' on [http://api.joomla.org/1.5/Joomla-Framework/Application/JController.html api.joomla.org]
 
* {{JVer|1.5}} '''JController source code''' on [[jframework15:application/component/controller.php|JoomlaCode]]
 
* {{JVer|1.5}} '''JController source code''' on [[jframework15:application/component/controller.php|JoomlaCode]]
 
* {{JVer|1.5}} Subpackage [[Subpackage Application/1.5|Application]]
 
* {{JVer|1.5}} Subpackage [[Subpackage Application/1.5|Application]]

Latest revision as of 14:17, 13 February 2013

[edit] Joomla 1.5 JController

[edit] 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

[edit] 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]

[edit] Methods

Visibility Method name Description
public __construct Constructor.
public _addPath Adds to the search path for templates and resources.
public _createFileName Create the filename for a resource.
public _createModel Method to load and return a model object.
public _createView Method to load and return a view object.
public _setPath Sets an entire array of search paths for resources.
public authorize Authorization 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 or was to be 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 addModelPath Adds to the stack of model paths in LIFO order.
public addViewPath Add one or more view paths to the controller's stack, in LIFO order.
  • Defined in libraries/joomla/application/component/controller.php
  • Extends JObject

[edit] Importing

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

[edit] See also

SeeAlso:JController [Edit See Also]

[edit] User contributed notes

<CodeExamplesForm />


Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox