Philip Crow > Bigtop > docs/keyword_cookbook/field/html_form_options/discussion


Annotate this POD


New  2
Open  1
View/Report Bugs


All field keywords beginning with html_form_ are passed directly into the form hash. Thus, they are really defined in which ships with Gantry.

Use html_form_options to specify the choices for fields of html_form_type select. The options are a comma separated list of pair. The first member of the pair is the label the user will see, the second is the value that will be in the params hash. With AutoCRUD, the value goes directly into the database.

If you use DBIx::Class, your model will have a method whose name starts the same as the field, but ends with _display. Call this method with the value from the table row; it will return the label ready for display back to the user.


To see an example, build:

    bigtop -c example.bigtop all

Change to the newly created Kids directory and look in the form method in lib/Kids/GEN/ to see the options being passed to the template; and in lib/Kids/Model/GEN/ for the gender_display method.

syntax highlighting: