/** * Create an <input type="text" /> field * * @param string $name Field name * @param string $value Field value * @param bool $sticky If set to true, the last posted value will be used */ public function __construct($name, $value = null, $sticky = true) { if ($sticky && isset($_POST[$name])) { $value = $_POST[$name]; } parent::__construct('text', $name, $value); }
/** * Create an <input type="password" /> field * * @param string $name Field name * @param string $value Field value */ public function __construct($name = 'password', $value = null) { if (isset($_POST[$name])) { $value = $_POST[$name]; } parent::__construct('password', $name, $value); }
/** * Create an <input type="text" /> field * * @param string $name Field name * @param string $value Field value * @param bool $sticky If set to true, the last posted value will be used */ public function __construct($name, $value = null, $min = 0, $max = 100, $sticky = true) { if ($sticky && isset($_POST[$name])) { $value = $_POST[$name]; } $this->addAttributes(array('min' => $min, 'max' => $max)); parent::__construct('number', $name, $value); }
/** * Construct a radio button object * @param mixed $value the value of the field * @param array $values the array of values of radio buttons in the set */ function __construct($value, $values) { parent::__construct($value, null); $this->values = $values; $this->ia = new IterableArray($values); if(!$value) { $this->setValue(array_shift($values)); } }
public function __construct($name, $value = null, $sticky = true) { if ($sticky && isset($_POST[$name]) && isset($_POST[$name][$value]) && $_POST[$name][$value] == 'on') { $this->setChecked(); } $name = $name . '[' . $value . ']'; parent::__construct('checkbox', $name); }
/** * {@inheritDoc} */ public function __construct($key, array $options = array()) { $options['type'] = 'hidden'; parent::__construct($key, $options); }
/** * Construct new check box form input field with flag $value. If the * $value evaluates to true then the check box will be on. * * @param bool $value the state of the check box. */ function __construct($value = false) { parent::__construct($value, null); }
/** * Construct a text input field with default value, validator and a given type * * @param string $value default value * @param Validator $validator validator of the field * @param int $type input field type (TEXT, TEXTAREA, PASSWORD) */ function __construct($value = '', $validator = null, $type = TextInputField::TEXT) { parent::__construct($value, $validator); $this->type = $type; }
public function __construct($name, $value) { parent::__construct('hidden', $name, $value); }
public function __construct($name, $values, $value = null) { parent::__construct('radio', $name, $value); $this->values = $values; }