Reputation: 9
I'm developing a custom mvc component for Joomla 2.5.
For my admin section I included a "New" button in the toolbar. By clicking this button I want to display a separate form with less fields. So far everything works out but the buttons of the view's toolbar won't redirect (i.e. 'Cancel')
To redirect the task 'add' I added an override of the method "add()" to my controller:
class ArchitectProjectControllerArchitectProject extends JControllerForm
{
public function add()
{
JRequest::setVar('layout', 'add');
$result = parent::add();
return $result;
}
}
I don't know if I'm on the right track. Probably someone can give me a hint?
Upvotes: 0
Views: 525
Reputation: 543
If you wish to redirect for example on 'Cancel' then try the following in the controller:
public function cancel()
{
$this->setRedirect('index.php?option='.$this->option.'&view=yourview');
}
Upvotes: 1