public function __construct($Attribs = array()) { $this->Code .= '<input type="file"'; $this->Code .= parent::parseAttribs($Attribs); $this->Code .= ' />'; $this->Attribs = $Attribs; }
protected function __construct($Type, $Attribs = array()) { $this->Code .= parent::getPend1($Attribs); $this->Code .= '<input type="' . $Type . '"' . parent::parseAttribs($Attribs) . ' />'; $this->Code .= parent::getPend2($Attribs); $this->Attribs = $Attribs; }
public function __construct($Attribs = array()) { $this->Code .= parent::getPend1($Attribs); $this->Code .= '<input type="password"' . parent::parseAttribs($Attribs) . ' />'; $this->Code .= parent::getPend2($Attribs); $this->Attribs = $Attribs; }
protected function build($Label, $Attribs) { $this->Code .= '<button '; $this->Code .= parent::parseAttribs($Attribs); $this->Code .= '>' . $Label . '</button>'; $this->Attribs = $Attribs; }
/** * Initializes a radio button * * @param string $Label Text associated with the button * @param array $Attribs * @param bool $Inline If true, appears on the same line as other radio buttons in the same group */ public function __construct($Label = '', $Attribs = array(), $Inline = false) { $this->Code .= '<label class="radio'; if ($Inline) { $this->Code .= ' inline'; } $this->Code .= '"><input type="radio"'; $this->Code .= parent::parseAttribs($Attribs); $this->Code .= ' />' . $Label . '</label>'; $this->Attribs = $Attribs; }
/** * Initializes the select * * @param array $Options Available options for the input * @param null|array $Selected The default selected option. Can be a single option or an array of options. Options start with an index of 0 * @param array $Attribs */ public function __construct($Options = array(), $Selected = null, $Attribs = array()) { $this->Code .= '<select'; $this->Code .= parent::parseAttribs($Attribs); $this->Code .= '>'; //Convert $Selected to array if necessary if (!is_array($Selected)) { $Selected = (array) $Selected; } foreach ($Options as $key => $val) { $this->Code .= '<option value="' . $key . '"'; if (in_array($key, $Selected, true)) { $this->Code .= ' selected'; } $this->Code .= '>' . $val . '</option>'; } $this->Code .= '</select>'; $this->Attribs = $Attribs; }
/** * Defines hidden inputs within the form * Can accept a single array to create one input or a multidimensional array to create many inputs * * @param $Inputs array An array of arrays or an associative array that sets the inputs attributes * @return Form */ public function hidden($Inputs = array()) { foreach ($Inputs as $i) { if (is_array($i)) { $this->Code .= '<input type="hidden"' . parent::parseAttribs($i) . ' />'; } else { $this->Code .= '<input type="hidden"' . parent::parseAttribs($Inputs) . ' />'; break; } } return $this; }
public function __construct($Attribs = array()) { $this->Code .= '<input type="hidden"' . parent::parseAttribs($Attribs) . ' />'; $this->Attribs = $Attribs; }
public function __construct($Value = '', $Attribs = array()) { $this->Code = '<textarea' . parent::parseAttribs($Attribs) . '>' . $Value . '</textarea>'; }