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

Florian Rival contact at oktopuce.fr
Thu Sep 26 14:17:51 CEST 2013


Yes  I have.

Le 26/09/2013 14:10, Xavier Perseguers a écrit :
> 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?
>



More information about the TYPO3-project-typo3v4mvc mailing list