0
votes

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?

1
Offtopic: You really selected a long name for your project. Can Architect be anything else but a Project? Do you also have like ArchitectTask ,etc? - Valentin Despa
there are also sections that can be associated to a project. They are called ArchitectSections. - user2262890
is Architect is in every class name as prefix, it makes sense to remove it :) doesn't it? - Valentin Despa

1 Answers

1
votes

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');
}