[Flow] Form ViewHelper for property that is an array of strings
Christian Loock
chl at vkf-renzel.de
Thu Jul 24 16:32:07 CEST 2014
Hi Bastian,
you might be right that from case to case it might be better not to use
arrays, but in my case I feel like creating a new Model to just store
simple strings, would be a bit to much.
Thank you for your example, I will try it out. Will this also work with
numerical indices?
On 24.07.2014 16:26, Bastian Waidelich wrote:
> Christian Loock wrote:
>
> Hi Christian,
>
>> I wonder if there is some sort of best practice for form fields, that
>> shall represent arrays of scalar types.
>
> The best practice would be not to use arrays.. *duck*
> SCNR, and sometimes arrays do make a lot of sense of course.
>
>
>> What i essentially need is something like this:
>>
>> <f:form.arrayfield property="Bar" value="{Foo.Bar}"/>
>>
>> Is this possible with flow / fluid?
>
>
> Not out of the box, but of course you could create a
> Form\ArrayfieldViewHelper.
> But probably you won't even need that - If I got you right, this is
> what you need:
>
> https://gist.github.com/bwaidelich/ae5a8245161f3f1cee5e
>
> But be aware: By tweaking the POST data one can add arbitrary keys to
> the array so you should sanitize it on the server-side.
>
--
Christian Loock
Web Developer
Renzel Agentur
www.renzel-agentur.de
More information about the Flow
mailing list