[TYPO3-english] switch actions when action is set by switchableControllerActions

Muriel le Pair typo3 at strangefruit.nl
Fri Jun 14 16:17:36 CEST 2013


Hi,

I have an extension with 3 actions that can be set by 
switchableControllerActions.

By default a list is shown. If you click on a link the details are shown 
one the same page. This on itself works fine, without realurl.

fixedPostVars in realurl only works correct is I set 
switchableControllerActions to details, because otherwise it needs the 
show action in order to switch.

This can be fixed by using postVarSets for the action part. But this 
results in a really ugly url:
www.domain.com/page/title-of-case/controller/show/
I would like it to be:
www.domain.com/page/title-of-case/

So I came up with the following solution: if there are no $cases to 
display the listAction.

I tried the following (doesn't work):

public function showAction(\SF\SfCases\Domain\Model\Cases $cases = NULL) {
		
   if ($cases == NULL) {
	$this->redirect('list');	
    } else
	$this->view->assign('cases', $cases);
	
}

So, how do I switch from one action to another action (without clicking 
on a link)?

--
kind regards,

Muriel le Pair




More information about the TYPO3-english mailing list