public function render(&$upload, $errors = array()) { // Load base template and attributes $result = parent::render($render_variables, $errors); $result['template']->element = form::textarea($result['attributes'], $this->value); // Return the resulting output return (string) $result['template']->render(); }
public function render(&$render_variables, $errors = array()) { $result = parent::render($render_variables, $errors); // If $force_selection is TRUE, add 'Please select...' as first item if ($this->force_selection) { $this->options = array('_NO_SELECTION_' => ucfirst(Kohana::lang('morf.pleaseselect'))) + $this->options; } return $result; }
public function render(&$render_variables, $errors = array()) { $result = parent::render($render_variables, $errors); // Clean attributes $id = $this->_clean_attributes($result['attributes'], 'id'); $buffer = $this->_create_rating($result['attributes']); $result['template']->element = $buffer; $result['template']->attributes = form::attributes($result['attributes']); return (string) $result['template']->render(); }
public function render(&$render_variables, $errors = array()) { // Load base template and attributes $result = parent::render($render_variables, $errors); if (is_array($result) and $result['type'] == 'submit') { $render_variables['submit'] = TRUE; } $result['template']->element = form::button($result['attributes'], $this->value); // Return the resulting output return (string) $result['template']->render(); }
public function render(&$render_variables, $errors = array()) { // Load base template and attributes $result = parent::render($render_variables, $errors); $result['template']->element = $this->value; $result['attributes'] = $this->_filter_attributes(array('name'), $result['attributes']); if ($result['attributes']) { $result['template']->attributes = form::attributes($result['attributes']); } // Return the resulting output return (string) $result['template']->render(); }
public function render(&$render_variables, $errors = array()) { // Load base template and attributes $result = parent::render($render_variables, $errors); // Discover the type switch ($this->type) { case 'input': $result['template']->element = form::input($result['attributes'], $this->value); break; case 'password': $result['template']->element = form::password($result['attributes'], $this->value); break; case 'submit': $result['template']->element = form::submit($result['attributes'], $this->value); $render_variables['submit'] = TRUE; break; case 'radio': $result['template']->element = form::radio($result['attributes'], $this->value); break; case 'checkbox': $result['attributes']['value'] = $this->value; if ($this->value = Input::instance()->post($this->name)) { $result['template']->element = form::checkbox($result['attributes'], $this->value, TRUE); } else { $result['template']->element = form::checkbox($result['attributes'], $this->value); } break; case 'hidden': $result['template']->element = form::hidden($this->name, $this->value); break; case 'file': $result['template']->element = form::upload($result['attributes'], $this->value); $render_variables['enctype'] = 'multipart/form-data'; break; } // Return the resulting output return (string) $result['template']->render(); }