[FLOW3-general] form.select and default item
"Christian Müller (Kitsunet)"
christian.mueller at typo3.org
Fri Dec 30 11:36:45 CET 2011
Hi both of you,
just for clarification, you are both talking about extBase here, FLOW3
has no findByUid.
Cheers,
Christian
On 30/12/11 11:30, Pankaj Lele wrote:
> Hello Thomas,
>
>> I'm trying to add an empty category item on my form.select. But like it was mentioned in this old topic, the
>> mapper fails because it tries to run: $categoryRepository->findByUid(0)
>> which throws an exception.
>> Any idea on how to fix that?
>
> I generally fix this in the controller itself. So you can do following
> in your controller->action()
>
> $categories = $categoryRepository->findAll()->toArray();
> $categories = array_merge(array(0 => ' Default category '), $categories);
> $this->view->assign('categories', $categories);
>
> Happy new year!
>
>
More information about the FLOW3-general
mailing list