Phorm/Field.class.php
/**
	 * Returns the field's errors, optionally wrapped in a div
	 *
	 * @param boolean $tag determines whether or not to wrap each error message in a <div> (defaults to TRUE)
	 * @return string the field errors as an unordered list
	 */
Returns the field's errors, optionally wrapped in a div
@param boolean $tag determines whether or not to wrap each error message in a  (defaults to TRUE)
@return string the field errors as an unordered list
Returns the field ' s errors optionally wrapped in a div @param boolean $tag determines whether or not to wrap each error message in a ( defaults to TRUE ) @return string the field errors as an unordered list
public function errors($tag=TRUE)
	{
		$elts = array();
		if( is_array($this->errors) && !empty($this->errors) )
		{
			foreach( $this->errors as $valid => $error )
			{
				if($tag)
				{
					$elts[] = sprintf('<div class="validation-advice" id="advice-%s-%s">%s</div>', $error[0], (string) $this->get_attribute('id'), $this->lang->{$error[1]});
				}
				else
				{
					$elts[] = $this->lang->{$error[1]};
				}
			}
			return implode("\n", $elts);
		}
		return (empty($elts))?'':$elts;
	}
public function errors ( $ tag = TRUE ) { $ elts = array ( ) ; if ( is_array ( $ this -> errors ) && ! empty ( $ this -> errors ) ) { foreach ( $ this -> errors as $ valid => $ error ) { if ( $ tag ) { $ elts [ ] = sprintf ( '<div class="validation-advice" id="advice-%s-%s">%s</div>' , $ error [ 0 ] , ( string ) $ this -> get_attribute ( 'id' ) , $ this -> lang -> { $ error [ 1 ] } ) ; } else { $ elts [ ] = $ this -> lang -> { $ error [ 1 ] } ; } } return implode ( " \n " , $ elts ) ; } return ( empty ( $ elts ) ) ? '' : $ elts ; }
Returns the field's errors, optionally wrapped in a div
 @param boolean $tag determines whether or not to wrap each error message in a <div> (defaults to TRUE)
 @return string the field errors as an unordered list
Returns the field ' s errors optionally wrapped in a div @param boolean $tag determines whether or not to wrap each error message in a <div > ( defaults to TRUE ) @return string the field errors as an unordered list