[TYPO3-mvc] Problems with passing parameters via redirect function
Fabian Mielke
fm at medienmacher.de
Tue Mar 2 14:09:29 CET 2010
Hello,
I am struggeling to pass parameters from one action to another. In my code I
have 2 actions:
/**
*
* @param array $customers
*/
public function viewAction($customers = null){
debug($customers, __FILE__.' '.__LINE__);
if(empty($customers)){
$customers = $this->fluidRepository->findAll();
}
$this->view->assign('customers', $customers);
}
/**
*
* @param String $letter
*/
public function alphabeticalFilterAction($letter){
$customers = $this->fluidRepository->findAllByLetter($letter);
debug($customers, __FILE__.' '.__LINE__);
$this->redirect('view', NULL, NULL, array('customers' => $customers));
}
The return values of findAllByLetter() and findAll() is an array in the form
[0] => Tx_MmFluidTutorial_Domain_Model_Customer
[1] => Tx_MmFluidTutorial_Domain_Model_Customer
After passing this array from action "alphabeticalFilterAction" to
"viewAction" via the redirect function the array has changed to
[0] => String
[1] => String
The strings are now the uid of a customer. So why does the array value
object type changes after passing it to another action? In this example the
two actions are in the same Controller, so its maybe possible to make a
direct call of the "viewAction" function, but how can I handle it when the
actions are in two different controllers.
Thanks for your help
--
Fabian Mielke
More information about the TYPO3-project-typo3v4mvc
mailing list