Esempio n. 1
0
 public function render(&$render_variables, $errors = array())
 {
     $result = parent::render($render_variables, $errors);
     // Clean attributes
     $id = $this->_clean_attributes($result['attributes'], 'id');
     $buffer = array();
     foreach ($this->options as $value => $title) {
         if ($this->value == $value) {
             $buffer[inflector::underscore($title)] = form::radio($result['attributes'], $value, TRUE);
         } else {
             $buffer[inflector::underscore($title)] = form::radio($result['attributes'], $value);
         }
     }
     $result['template']->element = $buffer;
     return (string) $result['template']->render();
 }
Esempio n. 2
0
 public function render(&$render_variables, $errors = array())
 {
     $result = parent::render($render_variables, $errors);
     $result['template']->element = form::dropdown($result['attributes'], $this->options, $this->value);
     return (string) $result['template']->render();
 }