public $cleaned_data = array();
public $errors = array();
public $is_bound = false;
- public $f = null;
- public $before_render = '';
- public $after_render = '';
public $label_suffix = ':';
protected $is_valid = null;
}
$this->initial = \PFF\Arr::get($extra, 'initial', array());
$this->initFields($extra);
- $this->f = new IPF_Form_FieldProxy($this);
}
abstract protected function initFields($extra=array());
public function clean()
{
- foreach ($this->fields as $name=>$field) {
- $field->LateClean($this->data, $this->cleaned_data);
- }
return $this->cleaned_data;
}
class IPF_Form_Field
{
- public $class = 'IPF_Form_Field';
-
public $widget = 'IPF_Form_Widget_TextInput';
public $label = '';
public $required = false;
public $help_text = '';
public $choices = null;
-
- public $hidden_widget = 'IPF_Form_Widget_HiddenInput';
public $value = ''; /**< Current value of the field. */
protected $empty_values = array('', null, array());
return $value;
}
- function LateClean($data, &$cleaned_data)
- {
- }
-
protected function createWidget($args)
{
$widgetClass = $this->widget;
+++ /dev/null
-<?php
-
-class IPF_Form_FieldProxy
-{
- protected $form = null;
-
- public function __construct(&$form)
- {
- $this->form = $form;
- }
-
- public function __get($field)
- {
- return new IPF_Form_BoundField($this->form, $this->form->fields[$field], $field);
- }
-}