Did you look at the wiki about adding "backend actions"?
Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
// separate the controler from the task, if necessary
$vars = explode(".",JRequest::getVar('task'));
If (count($vars)>1){
JRequest::setVar('controller',$vars[0]);
JRequest::setVar('task',$vars[1]);
}
// no direct access
defined('_JEXEC') or die('Restricted access');
// Require the base controller
require_once (JPATH_COMPONENT.DS.'controller.php');
$document = JFactory::getDocument();
$cssFile = JURI::base(true).'/components/com_inscricaoexames/css/inscricaoexames.css';
$document->addStyleSheet($cssFile, 'text/css', null, array());
// separate the controler from the task, if necessary
$vars = explode(".",JRequest::getVar('task'));
If (count($vars)>1){
JRequest::setVar('controller',$vars[0]);
JRequest::setVar('task',$vars[1]);
}
// Require specific controller if requested
if($controller = JRequest::getVar('controller')) {
$path = JPATH_COMPONENT_ADMINISTRATOR.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
require_once $path;
}
else {
$controller = '';
}
}
// Create the controller
$classname = 'inscricaoexamesController'.$controller;
$controller = new $classname( );
// Perform the Request task
$controller->execute( JRequest::getVar('task'));
// Redirect if set by the controller
$controller->redirect();
// no direct access
defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
$cssFile = JURI::base(true).'/components/com_inscricaoexames/css/inscricaoexames.css';
$document->addStyleSheet($cssFile, 'text/css', null, array());
// Get the Controller
$controller = JController::getInstance('inscricaoexames');
// Perform the Request task
$controller->execute( JRequest::getVar('task'));
// Redirect if set by the controller
$controller->redirect();
Instead of manually creating an instance of the controller, you should
be able to defer to JController::getInstance.
Cheers,
Sam Moffatt
http://pasamio.id.au
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/K9Fum3rYDqsJ.
RING RING - alarmbells all over the place - Sorry Sam but this was the
source of a bunch of hacks in J 1.5...
Please use only:
$controller->execute(JRequest::getCmd('task'));
Cheers,
Sam Moffatt
http://pasamio.id.au
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.