Procedural File: form_options_helper.php
Source Location: /vendor/trax/action_view/helpers/form_options_helper.php
Page Details:
File containing the FormOptionsHelper class and support functions
(PHP 5)
Tags:
collection_select [line 348]
void collection_select(
mixed $object_name, mixed $attribute_name, mixed $collection, mixed $attribute_value, mixed $attribute_text, [mixed $options = array()], [mixed $html_options = array()])
|
|
Create a new FormOptionsHelper object and call its to_collection_select_tag() method Return select and option tags for the given object and method using options_from_collection_for_select to generate the list of option tags. Example with $post->person_id => 1: $person = new Person; $people = $person->find_all(); collection_select("post", "person_id", $people, "id", "first_name", array("include_blank" => true)) could become: <select name="post[person_id]"> <option></option> <option value="1" selected="selected">David</option> <option value="2">Sam</option> <option value="3">Tobias</option> </select>
Tags:
country_select [line 364]
void country_select(
mixed $object_name, mixed $attribute_name, [mixed $priority_countries = null], [mixed $options = array()], [mixed $html_options = array()])
|
|
Create a new FormOptionsHelper object and call its to_country_select_tag() method Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.
Tags:
options_for_select [line 376]
void options_for_select(
string[] $choices, [integer $selected = null])
|
|
Create a new FormOptionsHelper object and call its options_for_select() method
Tags:
Parameters
string[] |
$choices |
List of choices |
integer |
$selected |
Index of the selected choice |
select [line 319]
void select(
mixed $object_name, mixed $attribute_name, mixed $choices, [mixed $options = array()], [mixed $html_options = array()])
|
|
Create a new FormOptionsHelper object and call its to_select_tag() method Create a select tag and a series of contained option tags for the provided object and method. The option currently held by the object will be selected, provided that the object is available. See options_for_select for the required format of the choices parameter. Example with $post->person_id => 1: $person = new Person; $people = $person->find_all(); foreach($people as $person) { $choices[$person->id] = $person->first_name; } select("post", "person_id", $choices, array("include_blank" => true)) could become: <select name="post[person_id]"> <option></option> <option value="1" selected="selected">David</option> <option value="2">Sam</option> <option value="3">Tobias</option> </select> This can be used to provide a functionault set of options in the standard way: before r}ering the create form, a new model instance is assigned the functional options and bound to
Tags:
|
|