Example #1
0
 /**
  * Returns the field as serialized HTML.
  * @author Jeff Ober
  * @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);
 }
Example #2
0
 /**
  * Returns the field as serialized HTML.
  * @author Jeff Ober
  * @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'] = 'password';
     return parent::serialize($value, $attributes);
 }
Example #3
0
 /**
  * Returns the field as serialized HTML.
  * @author Jeff Ober
  * @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);
 }
Example #4
0
 /**
  * Returns the button as serialized HTML.
  * @author Thomas Lété
  * @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);
 }