| Joomla MVC Component |
|
In Joomla 1.5, the MVC pattern is implemented using three classes:
A basic component only require file files:
For a complete MVC component, require these additional files:
xxx.php
// Require the base controller
require_once(JPATH_COMPONENT.DS.'controller.php');
// Create the controller
$controller = new XxxController();
// Perform the Request task
$controller->execute(JRequest::getVar('task'));
// Redirect if set by the controller
$controller->redirect();
views/xxx/view.html.php
class XxxViewXxx extends JView {
function display($tpl = null) {
$model = &$this->getModel();
......
parent::display($tpl);
}
}
|