Example #1
0
 public function render()
 {
     $checked = $this->getValue() == $this->get('value') ? 'checked' : null;
     $this->set('checked', $checked);
     $this->set('type', 'radio');
     return parent::render();
 }
Example #2
0
 /**
  * @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);
 }
Example #3
0
 public function render()
 {
     $this->setAttribute('type', 'checkbox');
     if ($this->value) {
         $this->setAttribute('checked', 'checked');
     } else {
         $this->setAttribute('checked');
     }
     return parent::render();
 }
Example #4
0
 /**
  * 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;
 }
Example #5
0
 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();
 }
Example #6
0
 public function render()
 {
     $this->setType('password');
     return parent::render();
 }
Example #7
0
 public function render()
 {
     $this->checkBinding();
     return parent::render();
 }
Example #8
0
File: Text.php Project: pr-of-it/t4
 public function render()
 {
     $this->setType('text');
     return parent::render();
 }
Example #9
0
 /**
  * @return string
  */
 public function render()
 {
     $this->attributes['value'] = null;
     return parent::render();
 }
Example #10
0
 public function render()
 {
     return parent::render() . $this->getLabel();
 }
Example #11
0
 public function render()
 {
     $this->setType('number');
     return parent::render();
 }
Example #12
0
 public function render($key, $extra = '')
 {
     return parent::render($key, $extra . ' class="simwp-color-field"');
 }
Example #13
0
 public function render()
 {
     $this->set('type', 'hidden');
     $this->set('value', $this->getValue());
     return parent::render();
 }
Example #14
0
 public function render()
 {
     $this->set('type', 'file');
     return parent::render();
 }
Example #15
0
 /**
  * @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);
 }
Example #16
0
 public function render($name, $value = null, array $attrs = array())
 {
     return parent::render($name, null, $attrs);
 }