public function render($name, $value, $extra_attrs = array()) { if ($this->render_value === false) { $value = ''; } return parent::render($name, $value, $extra_attrs); }
/** * Renders the HTML of the input. * * @param string Name of the field. * @param mixed Value for the field, can be a non valid value. * @param array Extra attributes to add to the input form (array()) * @return string The HTML string of the input. */ public function render($name, $value, $extra_attrs = array()) { // Internally we use GMT, so we convert back to the current // timezone. if (strlen($value) > 0) { $value = date($this->format, strtotime($value . ' GMT')); } return parent::render($name, $value, $extra_attrs); }
/** * Renders the HTML of the input. * * @param string Name of the field. * @param mixed Value for the field, can be a non valid value. * @param array Extra attributes to add to the input form (array()) * @return string The HTML string of the input. */ public function render($name, $value, $extra_attrs = array()) { if ((bool) $value) { // We consider that if a value can be boolean casted to // true, then we check the box. $extra_attrs['checked'] = 'checked'; } // Value of a checkbox is always "1" but when not checked, the // corresponding key in the form associative array is not set. return parent::render($name, '1', $extra_attrs); }
public function render($name, $value, $extra_attrs = array()) { $value = ''; return parent::render($name, $value, $extra_attrs); }