[TYPO3-mvc] Fluid: form.select view helper and empty default item
Simon Schaufelberger
schaufelREMOVE-MEberger at punkt.de
Mon Feb 7 13:34:34 CET 2011
hi,
> $this->view->assign('categories', array_merge(array(0 => 'All
> Categories'), $this->categoryRepository->findAll()));
this doesn't work in TYPO3 4.5 any more.
i get:
> PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in [...]
Am 03.02.2010 12:23, schrieb Jochen Rau:
> Hi.
>
>> You can try something like:
>>
>> $tempCategory = new Tx_MyExtname_Domain_Model_Category();
>> $tempCategory->setCategorieName('---');
>>
>> ....
>> .... Dont' know what your model looks like!! and what has to come here
>> ....
>>
>> $categories = array_merge(array($tempCategory),
>> $yourCategorieRepository->findAll());
>
> As long as there is no real Category with the name "---" (obviously not)
> it feels a little bit awkward to me.
>
> My temporary solution is
>
> $this->view->assign('categories', array_merge(array(0 => 'All
> Categories'), $this->categoryRepository->findAll()));
>
> in my action method.
>
>
> Regards
> Jochen
--
Kind regards,
Schaufi from punkt.de
More information about the TYPO3-project-typo3v4mvc
mailing list