PHPonTrax
[ class tree: PHPonTrax ] [ index: PHPonTrax ] [ all elements ]

Class: FormOptionsHelper

Source Location: /vendor/trax/action_view/helpers/form_options_helper.php

Class Overview

Helpers
   |
   --FormHelper
      |
      --FormOptionsHelper



Author(s):

Methods


Inherited Variables

Inherited Methods

Class: FormHelper

FormHelper::__construct()
FormHelper::add_default_name_and_id()
FormHelper::tag_id()
FormHelper::tag_id_with_index()
FormHelper::tag_name()
FormHelper::tag_name_with_index()
FormHelper::to_boolean_select_tag()
FormHelper::to_check_box_tag()
FormHelper::to_input_field_tag()
Generate an HTML or XML input tag with optional attributes
FormHelper::to_radio_button_tag()
FormHelper::to_text_area_tag()

Class: Helpers

Helpers::__construct()
Construct a Helpers object
Helpers::boolean_attribute()
Convert an attribute to proper XML boolean form
Helpers::cdata_section()
Wrap CDATA begin and end tags around argument
Helpers::content_tag()
Generate an open/close pair of tags with optional attributes and content between
Helpers::convert_options()
Convert selected attributes to proper XML boolean form
Helpers::error_wrapping()
If this tag has an error, wrap it with a visual indicator
Helpers::object()
Given the name of an ActiveRecord subclass, find an instance
Helpers::tag()
Generate an HTML or XML tag with optional attributes and self-ending
Helpers::tag_options()
Convert array of tag attribute names and values to string
Helpers::to_content_tag()
Helpers::value()
Get value of current attribute in the current ActiveRecord object

Class Details

[line 85]


Tags:

todo:  Document this class


[ Top ]


Class Methods


method add_options [line 272]

void add_options( string $option_tags, array $options)



Tags:

todo:  Document this method
access:  private
usedby:  FormOptionsHelper::to_country_select_tag()
usedby:  FormOptionsHelper::to_select_tag()
usedby:  FormOptionsHelper::to_collection_select_tag()


Parameters:

string   $option_tags  
array   $options  

[ Top ]

method country_options_for_select [line 175]

void country_options_for_select( [integer $selected = null], [ $priority_countries = array()])

Generate HTML options for world countries



Tags:

todo:  FIXME: Second argument doesn't work


Parameters:

integer   $selected   Array key of country initially selected NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
   $priority_countries  

[ Top ]

method options_for_select [line 108]

string options_for_select( string[] $choices, [integer $selected = null])

Generate HTML option tags from a list of choices

Accepts an array of possible choices and returns a string of option tags. The value of each array element becomes the visible text of an option, and the key of the element becomes the value returned to the server. For example:
options_for_select(array('foo','bar'));
will return:
<option value="0">foo</option>\n
<option value="1">bar</option>

The optional second argument specifies the array key of an option to be initially selected.

NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.




Tags:



Parameters:

string[]   $choices   Choices
integer   $selected   Selected choice

[ Top ]

method options_from_collection_for_select [line 152]

void options_from_collection_for_select( $collection, $attribute_value, $attribute_text, [ $selected_value = null])

Returns a string of option tags that have been compiled by

iterating over the +collection+ and assigning the result of a call to the +value_method+ as the option value and the +text_method+ as the option text. If +selected_value+ is specified, the element returning a match on +value_method+ will get the selected option tag.

Example (call, result). Imagine a loop iterating over each +person+ in <tt>@project.people</tt> to generate an input tag: options_from_collection_for_select(@project.people, "id", "name") <option value="#{person.id}">#{person.name}</option>

NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.




Tags:

todo:  Document this method
usedby:  FormOptionsHelper::to_collection_select_tag()


Parameters:

   $collection  
   $attribute_value  
   $attribute_text  
   $selected_value  

[ Top ]

method to_collection_select_tag [line 224]

void to_collection_select_tag( $collection, $attribute_value, $attribute_text, $options, $html_options)



Tags:



Parameters:

   $collection  
   $attribute_value  
   $attribute_text  
   $options  
   $html_options  

[ Top ]

method to_country_select_tag [line 251]

void to_country_select_tag( $priority_countries, $options, $html_options)



Tags:



Parameters:

   $priority_countries  
   $options  
   $html_options  

[ Top ]

method to_select_tag [line 202]

void to_select_tag( $choices, $options, $html_options)



Tags:



Parameters:

   $choices  
   $options  
   $html_options  

[ Top ]


Documentation generated on Mon, 21 May 2007 22:28:32 -0600 by phpDocumentor 1.3.2