[TYPO3-mvc] Fluid: form.select view helper and empty default item
Mam Violeng
mam.violeng at yejj.com
Fri Mar 12 06:13:13 CET 2010
Jochen Rau wrote:
>
> $this->view->assign('categories', array_merge(array(0 => 'All
> Categories'), $this->categoryRepository->findAll()));
>
> in my action method.
Hi,
I used the code like this
$this->view->assign('projectType', array_merge(array(0 => '-- select one
-- Categories'), $this->projectTypeRepository->findAll()));
in my controller (in new action and edit action), but the problem when I
don't select any value (default is the first one with value 0) then when
I submit the form to update or save the value it appear the error bellow.
----
Argument 1 passed to Tx_Extension_Domain_Model_Project::setProjectType()
must be an instance of Tx_Extension_Domian_Model_ProjectType null given.
----
Any solution to solve this problem?
Thanks,
Violeng
More information about the TYPO3-project-typo3v4mvc
mailing list