Exemplo n.º 1
0
 /**
  * Returns the HTML string for this object
  * @return string HTML string
  */
 public function __toString()
 {
     $html = substr(parent::__toString(), 0, -1);
     if (!empty($this->placeholder)) {
         $html .= " placeholder='{$this->placeholder}'";
     }
     $html .= '>';
     return $html;
 }
Exemplo n.º 2
0
 /**
  * Returns the HTML string for this object
  * @return string HTML string
  */
 public function __toString()
 {
     $html = substr(parent::__toString(), 0, -1);
     if ($this->checked) {
         $html .= " checked";
     }
     $html .= '>';
     return $html;
 }
Exemplo n.º 3
0
 /**
  * Returns the HTML string for this object
  * @return string HTML string
  */
 public function __toString()
 {
     $html = '<select';
     $html .= substr(parent::__toString(), 6);
     foreach ($this->dropdown_data as $dropdown_item) {
         $selected = '';
         if (isset($dropdown_item['selected']) ? $dropdown_item['selected'] : false || $dropdown_item['value'] === $this->getValue()) {
             $selected = 'selected';
         }
         $html .= "<option value='{$dropdown_item['value']}' {$selected}>";
         $html .= $dropdown_item['text'];
         $html .= '</option>';
     }
     $html .= '</select>';
     return $html;
 }