. */ class Staple_Form_HiddenElement extends Staple_Form_Element { /* (non-PHPdoc) * @see Staple_Form_Element::Create() */ public static function Create($name, $value = NULL, $id = NULL, array $attrib = array()) { $result = parent::Create($name, NULL, $id, $attrib); if(isset($value)) { $result->setValue($value); } return $result; } /* (non-PHPdoc) * @see Staple_Form_Element::__construct() */ public function __construct($name, $value = NULL, $id = NULL, array $attrib = array()) { if(isset($value)) { $this->setValue($value); } parent::__construct($name,NULL,$id,$attrib); } /* (non-PHPdoc) * @see Staple_Form_Element::field() */ public function field() { return ' '."\n"; } /* (non-PHPdoc) * @see Staple_Form_Element::instructions() */ public function instructions() { return ''; } /* (non-PHPdoc) * @see Staple_Form_Element::label() */ public function label() { return ''; } public function build() { $buf = ''; $view = FORMS_ROOT.'/fields/HiddenElement.phtml'; if(file_exists($view)) { ob_start(); include $view; $buf = ob_get_contents(); ob_end_clean(); } else { $buf = $this->field(); } return $buf; } }