Exemple #1
0
 /**
  * Returns the field as serialized HTML.
  *
  * @param mixed $value the form widget's value attribute
  * @param array $attributes key=>value pairs corresponding to HTML attributes' name=>value
  * @return string the serialized HTML
  */
 protected function serialize($value, array $attributes = array())
 {
     $attributes['type'] = 'radio';
     if ($this->checked) {
         $attributes['checked'] = 'checked';
     }
     return parent::serialize($value, $attributes);
 }
Exemple #2
0
 /**
  * Returns the field as serialized HTML.
  *
  * @param mixed $value the form widget's value attribute
  * @param array $attributes key=>value pairs corresponding to HTML attributes' name=>value
  * @return string the serialized HTML
  */
 protected function serialize($value, array $attributes = array())
 {
     $attributes['type'] = 'text';
     return parent::serialize($value, $attributes);
 }
 /**
  * Returns the field as serialized HTML.
  *
  * @param mixed $value the form widget's value attribute
  * @param array $attributes key=>value pairs corresponding to HTML attributes' name=>value
  * @return string the serialized HTML
  */
 protected function serialize($value, array $attributes = array())
 {
     $attributes['type'] = 'file';
     $attributes['accept'] = implode(',', $this->types);
     return parent::serialize($value, $attributes);
 }
Exemple #4
0
 /**
  * Returns the button as serialized HTML.
  *
  * @param mixed $value the form widget's value attribute
  * @param array $attributes key=>value pairs corresponding to HTML attributes' name=>value
  * @return string the serialized HTML
  */
 protected function serialize($value, array $attributes = array())
 {
     $attributes['type'] = 'button';
     $attributes['onclick'] = 'window.location.href=\'' . str_replace("'", "\\'", $this->url) . '\'';
     return parent::serialize($value, $attributes);
 }