[FLOW3-general] non model fields in form

Carsten Bleicker carsten at bleicker.de
Wed Aug 8 13:14:30 CEST 2012


what about this?
public function createAction(\XY\Package\Domain\Model\User $newUser, $custom = '')

Am 08.08.2012 um 13:06 schrieb Wasko Jugovic:

> Hi,
> 
> Is it possible to have fields from a model together with some custom fields 
> (non-db) in one form?
> How can I get the value of  such a custom field  in my controller?
> 
> e.g.: I have a form with a field "name" from model User. Besides there is a 
> field "custom" which I want to access in my UserController's createAction.
> 
> 
> Template:
> <f:form action="create" name="newUser" object="{newUser}">
>     <f:form.textfield property="name" id="name" />
>     <f:form.textfield id="custom" name="custom"/>  // ??
>     <f:form.submit value="Create"/>
> </f:form>
> 
> 
> Controller:
> /**
>  * @param \XY\Package\Domain\Model\User $newUser A new user to add
>  * @return void
>  */
> public function createAction(\XY\Package\Domain\Model\User $newUser) {
> 
>    if ( $custom == "somevalue")  //??
>    {....
>    }
> 
> }
> 
> 
> thx 
> 
> 
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general



More information about the FLOW3-general mailing list