[nycphp-talk] Storing form options.
Jeff Slutz
jeff at jeffslutz.com
Wed Jul 11 16:35:31 EDT 2012
+1 to Joseph's approach.
--
Jeff Slutz
JSLEUTH LLC
3242 44th ST APT 3F
Astoria, NY 11103
c. 970.443.9390
jeff at jeffslutz.com
On Wed, Jul 11, 2012 at 4:33 PM, Joseph Crawford <codebowl at gmail.com> wrote:
> I would personally store any form options in a database table, I would
> have a form table and then a form_options table and get all options by form
> id.
>
> Thanks,
> Joseph Crawford
>
> On Wed, Jul 11, 2012 at 4:26 PM, Anthony Wlodarski <ant92083 at gmail.com>wrote:
>
>> When building lots of forms, irrespective of form size or complexity if
>> you need to store options where do you do it? I have seen many examples
>> but I guess this boils down to what is a best practice? The way things are
>> currently done is that all form options are stored in a static array in the
>> ecosystem and then called upon when the form needs to be built.
>>
>> For example, we ask users to select their Ethnicity when filling out one
>> of our forms. This includes the values: Prefer not to say, African
>> American, Asian, White, East Indian, Hispanic / Latino, Middle Eastern,
>> Native American, Other. Where would you store these options?
>>
>> Is this a matter of personal preference or is there a best practice I
>> missed over the years?
>>
>> --
>> Anthony W.
>> http://www.anthonyw.net
>> ant92083 at gmail.com
>>
>> ______________________________**_________________
>> New York PHP User Group Community Talk Mailing List
>> http://lists.nyphp.org/**mailman/listinfo/talk<http://lists.nyphp.org/mailman/listinfo/talk>
>>
>> http://www.nyphp.org/show-**participation<http://www.nyphp.org/show-participation>
>>
>
>
>
> --
> Joseph Crawford Jr.
> Zend Certified Engineer
> http://www.josephcrawford.com/
> 1-781-346-9656
> info at josephcrawford.com
>
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/show-participation
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20120711/dc4f4181/attachment.html>
More information about the talk
mailing list