Writing a Joomla 1.5 MVC Component

E-mail Print PDF
Article Index
Writing a Joomla 1.5 MVC Component
Building MVC Controller
References
All Pages

Writing Joomla 1.5 component is not an easy task. It's very different from Joomla 1.0 approach and documentation is not very clear. In this article we try clear the main points for those who a starting to write their first Joomla 1.5 component.

Hidden Rules

Respect to other MVC implementations (like for ex. JSF in Java) , where the behaviour can be parametrized in a configuration file, in Joomla MVC there are fixed rules, that you have to hold in mind.

First, you have to explicitly indicate the view name in your component URL, so, you can not select a view dynamically in your controller.:

http://example.com/index.php?option=com_<name>&view=<myview>[&task=<mytask>]

Second, the task parameter value corresponds to a method name in your controller, so you can not elaborate the same task with different methods. If you omit it you are defaulting to task=display.

With the URL above Joomla will import a file located at

/components/com_<name>/views/<myview>/view.html.php 

If these files or the path do not exist, Joomla  will fail. So, you have to provide a fake view, even if your component doesn't produce any direct output.

Having in mind the limitations above, let's start to build our Joomla 1.5 MVC component.


Building MVC Controller

Work in progress, please return later for full text ...

 


References

  1. How Joomla pieces work together
  2. Developing a Model-View-Controller Component