Actions

Difference between revisions of "How to override the component mvc from the Joomla! core"

From Joomla! Documentation

(Created page with "Tutorial")
 
Line 1: Line 1:
Tutorial
+
There may be occasions where you would like to override the way a Joomla! Components MVC to add a little new functionality or complete customize a component. Component MVC can be overridden by using a class with same name as we have on a component and we need to loading by using a system plugin before component are dispatched by application.
 +
 
 +
What you can override on MVC component?
 +
- View classes: [Component]View[Name]
 +
- Model classes: [Component]Model[Name]
 +
- Controller classes: [Component]Controller[Name]
 +
 
 +
Need to override layout?
 +
[[http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core]]
 +
 
 +
Getting a head-start with overrides
 +
 
 +
 
 +
Override Base Component Controller
 +
TEMPLATE_NAME/code/EXTENSION_NAME/CONTROLLER.php
 +
Override Another Component Controller
 +
TEMPLATE_NAME/code/EXTENSION_NAME/controllers/CONTROLLER_NAME.php
 +
 
 +
Override Models
 +
TEMPLATE_NAME/code/EXTENSION_NAME/models/CONTROLLER_NAME.php
 +
 
 +
If you use multiple templating on your site you can override by create a "local" folder on root folder and on administrator folder.

Revision as of 06:18, 22 March 2012

There may be occasions where you would like to override the way a Joomla! Components MVC to add a little new functionality or complete customize a component. Component MVC can be overridden by using a class with same name as we have on a component and we need to loading by using a system plugin before component are dispatched by application.

What you can override on MVC component? - View classes: [Component]View[Name] - Model classes: [Component]Model[Name] - Controller classes: [Component]Controller[Name]

Need to override layout? [[1]]

Getting a head-start with overrides


Override Base Component Controller TEMPLATE_NAME/code/EXTENSION_NAME/CONTROLLER.php Override Another Component Controller TEMPLATE_NAME/code/EXTENSION_NAME/controllers/CONTROLLER_NAME.php

Override Models TEMPLATE_NAME/code/EXTENSION_NAME/models/CONTROLLER_NAME.php

If you use multiple templating on your site you can override by create a "local" folder on root folder and on administrator folder.