[nycphp-talk] Storing form options.
Petros Ziogas
petros.ziogas at gmail.com
Wed Jul 18 08:35:07 EDT 2012
I prefer to create a "settings" table where I store all the bits and pieces
that need to be configurable but are not that frequently changed.
If you want to make everything translatable, I would not tie it to a
settings table but rather set up a global translate procedure that would
apply to these settings but also to other elements of your application.
I have found that deciding on some general rules around these issues can
make your life much easier. Jumping from project to project and realizing
that the countries are always in the settings table and always called in a
curtain way can make you day and save you some hours in debugging and
developing.
my 2c
Petros Ziogas
On Thu, Jul 12, 2012 at 5:54 PM, Chris Snyder <chsnyder at gmail.com> wrote:
> On Wed, Jul 11, 2012 at 4:26 PM, Anthony Wlodarski <ant92083 at gmail.com>
> wrote:
>
> > 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?
>
> Where you store them is a matter of style. I like using blocks of JSON
> for this, personally, but others would cringe at the parsing overhead.
>
> But however you keep them, I think the ideal solution needs to
> accommodate two things:
>
> 1) Localization/internationalization - if you're just storing American
> English values, you're limiting yourself. The labels for an Ethnicity
> selector can even vary region by region within the US. You may need to
> keep the choices the same in order to normalize the database, but the
> labels need to be translatable.
>
> 2) Meta-data about the selector itself. Multiple choice? An Other...
> field? Is it ideally a <select> or a series of radio buttons /
> checkboxes? Is there an instruction that goes along with the field? A
> default value?
> _______________________________________________
> 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/20120718/5f7caca5/attachment.html>
More information about the talk
mailing list