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

Jochen Rau jochen.rau at typoplanet.de
Wed Feb 3 12:23:44 CET 2010


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


More information about the TYPO3-project-typo3v4mvc mailing list