[TYPO3-mvc] Fluid: form.select view helper and empty default item

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Feb 7 14:51:34 CET 2011


Hey,

>> $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 [...]
>
> the type that i get back is:
> Tx_Extbase_Persistence_QueryResultInterface wich array_merge can't handle.

then convert it to an array:

$this->categoryRepository->findAll()->toArray();


-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list