[TYPO3-mvc] forward() with an object as argument

Xavier Perseguers xavier at typo3.org
Thu Sep 26 14:10:08 CEST 2013


Hi Florian,


> I would like to know if it's possible with the *forward()* method to
> pass a domain object as argument, see the code bellow :
> 
> public function listAction(\OKTOPUCE\myext\Domain\Model\Mymodel $mymodel
> = NULL) {
>     if ($mymodel == NULL)
>         $mymodel = $this->mymodelRepository->findAll();
> 
>     $this->view->assign('mymodel', $mymodel);
> }
> 
> public function listByTypeAction() {
>     $mymodel = $this->mymodelRepository->findByType(0);
>     $this->forward("list", NULL, NULL, array ('mymodel' => $mymodel));
> }
> 
> This code throw the following exception :
> 
> #1297759968: Exception while property mapping at property path "":The
> source is not of type string, array, float, integer or boolean, but of
> type "object"

Your actual code is not what you copied here and you are of course
documenting every method and their parameters with proper phpDoc, right?

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-project-typo3v4mvc mailing list