コード例 #1
0
ファイル: Radio.php プロジェクト: irfanevrens/html
 public function render()
 {
     $checked = $this->getValue() == $this->get('value') ? 'checked' : null;
     $this->set('checked', $checked);
     $this->set('type', 'radio');
     return parent::render();
 }
コード例 #2
0
ファイル: InputCheckbox.php プロジェクト: rande/sfFormBundle
 /**
  * @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);
 }
コード例 #3
0
ファイル: Checkbox.php プロジェクト: php-yaoi/php-yaoi
 public function render()
 {
     $this->setAttribute('type', 'checkbox');
     if ($this->value) {
         $this->setAttribute('checked', 'checked');
     } else {
         $this->setAttribute('checked');
     }
     return parent::render();
 }
コード例 #4
0
ファイル: File.php プロジェクト: slickframework/form
 /**
  * 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;
 }
コード例 #5
0
ファイル: Checkbox.php プロジェクト: irfanevrens/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();
 }
コード例 #6
0
ファイル: Password.php プロジェクト: pr-of-it/t4
 public function render()
 {
     $this->setType('password');
     return parent::render();
 }
コード例 #7
0
ファイル: Checkbox.php プロジェクト: adamwathan/form
 public function render()
 {
     $this->checkBinding();
     return parent::render();
 }
コード例 #8
0
ファイル: Text.php プロジェクト: pr-of-it/t4
 public function render()
 {
     $this->setType('text');
     return parent::render();
 }
コード例 #9
0
ファイル: Password.php プロジェクト: sevikerr/form
 /**
  * @return string
  */
 public function render()
 {
     $this->attributes['value'] = null;
     return parent::render();
 }
コード例 #10
0
ファイル: Checkbox.php プロジェクト: Clansuite/Clansuite
 public function render()
 {
     return parent::render() . $this->getLabel();
 }
コード例 #11
0
ファイル: Number.php プロジェクト: pr-of-it/t4
 public function render()
 {
     $this->setType('number');
     return parent::render();
 }
コード例 #12
0
ファイル: ColorPicker.php プロジェクト: dumday/simwp
 public function render($key, $extra = '')
 {
     return parent::render($key, $extra . ' class="simwp-color-field"');
 }
コード例 #13
0
ファイル: Hidden.php プロジェクト: siriusphp/html
 public function render()
 {
     $this->set('type', 'hidden');
     $this->set('value', $this->getValue());
     return parent::render();
 }
コード例 #14
0
ファイル: File.php プロジェクト: irfanevrens/html
 public function render()
 {
     $this->set('type', 'file');
     return parent::render();
 }
コード例 #15
0
ファイル: InputPassword.php プロジェクト: rande/sfFormBundle
 /**
  * @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);
 }
コード例 #16
0
ファイル: Inputs.php プロジェクト: vincenta/stato
 public function render($name, $value = null, array $attrs = array())
 {
     return parent::render($name, null, $attrs);
 }