コード例 #1
0
 public function render($name, $value, $extra_attrs = array())
 {
     if ($this->render_value === false) {
         $value = '';
     }
     return parent::render($name, $value, $extra_attrs);
 }
コード例 #2
0
ファイル: DatetimeInput.php プロジェクト: burbuja/pluf
 /**
  * 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);
 }
コード例 #3
0
ファイル: CheckboxInput.php プロジェクト: burbuja/pluf
 /**
  * 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);
 }
コード例 #4
0
ファイル: FileInput.php プロジェクト: burbuja/pluf
 public function render($name, $value, $extra_attrs = array())
 {
     $value = '';
     return parent::render($name, $value, $extra_attrs);
 }