public function render() { $checked = $this->getValue() == $this->get('value') ? 'checked' : null; $this->set('checked', $checked); $this->set('type', 'radio'); return parent::render(); }
/** * @param string $name The element name * @param string $value The this widget is checked if value is not null * @param array $attributes An array of HTML attributes to be merged with the default HTML attributes * @param array $errors An array of errors for the field * * @return string An HTML tag string * * @see */ public function render($name, $value = null, $attributes = array(), $errors = array()) { if (null !== $value && $value !== false) { $attributes['checked'] = 'checked'; } if (!isset($attributes['value']) && null !== $this->getOption('value_attribute_value')) { $attributes['value'] = $this->getOption('value_attribute_value'); } return parent::render($name, null, $attributes, $errors); }
public function render() { $this->setAttribute('type', 'checkbox'); if ($this->value) { $this->setAttribute('checked', 'checked'); } else { $this->setAttribute('checked'); } return parent::render(); }
/** * Render the HTML element in the provided context * * @param array $context * * @return string The HTML string output */ public function render($context = []) { $element = clone $this->element; $value = $this->element->getAttribute('value', false); if ($value !== false) { $this->element->getAttributes()->remove('value'); } $html = parent::render($context); $this->element = $element; return $html; }
public function render() { $checked = null; if (is_array($this->getValue()) && in_array($this->get('value'), $this->getValue())) { $checked = 'checked'; } elseif ($this->get('value') == $this->getValue()) { $checked = 'checked'; } $this->set('checked', $checked); $this->set('type', 'checkbox'); return parent::render(); }
public function render() { $this->setType('password'); return parent::render(); }
public function render() { $this->checkBinding(); return parent::render(); }
public function render() { $this->setType('text'); return parent::render(); }
/** * @return string */ public function render() { $this->attributes['value'] = null; return parent::render(); }
public function render() { return parent::render() . $this->getLabel(); }
public function render() { $this->setType('number'); return parent::render(); }
public function render($key, $extra = '') { return parent::render($key, $extra . ' class="simwp-color-field"'); }
public function render() { $this->set('type', 'hidden'); $this->set('value', $this->getValue()); return parent::render(); }
public function render() { $this->set('type', 'file'); return parent::render(); }
/** * @param string $name The element name * @param string $value The password stored in this widget, will be masked by the browser. * @param array $attributes An array of HTML attributes to be merged with the default HTML attributes * @param array $errors An array of errors for the field * * @return string An HTML tag string * * @see sfWidgetForm */ public function render($name, $value = null, $attributes = array(), $errors = array()) { return parent::render($name, $this->getOption('always_render_empty') ? null : $value, $attributes, $errors); }
public function render($name, $value = null, array $attrs = array()) { return parent::render($name, null, $attrs); }