function __construct($name = NULL) { $this->element = NHtml::el('form'); $this->element->action = ''; $this->element->method = self::POST; $this->element->id = 'frm-' . $name; $this->monitor(__CLASS__); if ($name !== NULL) { $tracker = new NHiddenField($name); $tracker->unmonitor(__CLASS__); $this[self::TRACKER_ID] = $tracker; } parent::__construct(NULL, $name); }
/** * Adds hidden form control used to store a non-displayed value. * @param string control name * @param mixed default value * @return NHiddenField */ public function addHidden($name, $default = NULL) { $control = new NHiddenField; $control->setDefaultValue($default); return $this[$name] = $control; }