Actions

J2.5

Difference between revisions of "Developing a MVC Component/Basic backend"

From Joomla! Documentation

< J2.5:Developing a MVC Component
m
(Basic backend)
Line 18: Line 18:
 
// No direct access to this file
 
// No direct access to this file
 
defined('_JEXEC') or die('Restricted access');
 
defined('_JEXEC') or die('Restricted access');
 
+
 
// import joomla controller library
 
// import joomla controller library
 
jimport('joomla.application.component.controller');
 
jimport('joomla.application.component.controller');
 
+
 
// Get an instance of the controller prefixed by HelloWorld
 
// Get an instance of the controller prefixed by HelloWorld
 
$controller = JController::getInstance('HelloWorld');
 
$controller = JController::getInstance('HelloWorld');
 
+
 
// Perform the Request task
 
// Perform the Request task
$input = JFactory::getApplication()->input;
+
$controller->execute(JRequest::getCmd('task'));
$controller->execute($input->getCmd('task'));
+
 
+
 
// Redirect if set by the controller
 
// Redirect if set by the controller
 
$controller->redirect();
 
$controller->redirect();
 +
 
</source>
 
</source>
 
</span>
 
</span>

Revision as of 13:26, 5 July 2012