Phorm/Widget/Select.class.php
/**
	 * Returns the field as serialized HTML.
	 *
	 * @param mixed $value the form widget's selected value
	 * @param array $attributes key=>value pairs corresponding to HTML attributes' name=>value
	 * @return string the serialized HTML
	 */
Returns the field as serialized HTML.

@param mixed $value the form widget's selected value
@param array $attributes key=>value pairs corresponding to HTML attributes' name=>value
@return string the serialized HTML
Returns the field as serialized HTML . @param mixed $value the form widget ' s selected value @param array $attributes key = > value pairs corresponding to HTML attributes ' name = > value @return string the serialized HTML
protected function serialize($value, array $attributes=array())
	{
		$options = array();
		foreach( $this->choices as $actual => $display )
		{
			$option_attributes = array( 'value' => $this->clean_string($actual) );
			if( $actual == $value )
			{
				$option_attributes['selected'] = 'selected';
			}
			$options[] = sprintf("<option %s>%s</option>\n", $this->serialize_attributes($option_attributes), $this->clean_string($display));
		}
		return sprintf('<select %s>%s</select>', $this->serialize_attributes($attributes), implode($options));
	}
protected function serialize ( $ value , array $ attributes = array ( ) ) { $ options = array ( ) ; foreach ( $ this -> choices as $ actual => $ display ) { $ option_attributes = array ( 'value' => $ this -> clean_string ( $ actual ) ) ; if ( $ actual == $ value ) { $ option_attributes [ 'selected' ] = 'selected' ; } $ options [ ] = sprintf ( " <option %s>%s</option> \n " , $ this -> serialize_attributes ( $ option_attributes ) , $ this -> clean_string ( $ display ) ) ; } return sprintf ( '<select %s>%s</select>' , $ this -> serialize_attributes ( $ attributes ) , implode ( $ options ) ) ; }
Returns the field as serialized HTML.
Returns the field as serialized HTML .