프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$app | App_Web | ||
$bail_out | null | boolean | If this is true, we won't load data or submit or validate anything. | |
$data | array | Afterwards fields will link to $this->data, so changing $this->data['fld_name'] would actually affect field's value. You should use $this->set() and $this->get() to read/write individual field values. You should use $this->setStaticSource() to load values from hash, BUT - AAAAAAAAAA: this array is no more!!! | |
$default_controller | Class name of default controller | ||
$default_exception | Class name of default exception | ||
$errors | array | Here we will have a list of errors occured in the form, when we tried to submit it. field_name => error | |
$js_widget | JS widget name | ||
$js_widget_arguments | JS widget options | ||
$layout | View | Template of layout if form has one. | |
$owner | View | ||
$search_for_field_spots | Normally form fields are inserted using a form template. If you. | ||
$template_chunks | array | Those templates will be used when rendering form and fields. | |
$validator | Validator object |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$ajax_submits | array | Contains AJAX instances assigned to buttons. | |
$conditions | array | ||
$get_field | null | string | If condition was passed to a form through GET, contains a GET field name. | |
$loaded_from_db | boolean | true - update() will try updating existing row. false - it would insert new. |
메소드 | 설명 | |
---|---|---|
addButton ( $label = 'Button', $name = null ) | ||
addClass ( $class ) | ||
addField ( AbstractView | array | string $type, AbstractView | array | string $options = null, string $caption = null, string $attr = null ) : Form_Field | Adds field in form. | |
addSeparator ( $class = '', $attr = [] ) | ||
addSubmit ( $label = 'Save', $name = null ) | ||
afterAdd ( $p, $c ) | ||
defaultTemplate ( $template = null, $tag = null ) | ||
displayError ( $field = null, $msg = null ) | ||
error ( string $field, string $text = null ) | Adds error message to form field. | |
get ( $field = null ) | ||
getAllFields ( ) | ||
grabTemplateChunk ( $name ) | ||
hasField ( $name ) | ||
importFields ( Model $model, array | string | boolean $fields = UNDEFINED ) | Imports model fields in form by using form controller. | |
init ( ) | }}} | |
isClicked ( $name ) | ||
isLoadedFromDB ( ) | ||
isSubmitted ( ) | ||
lateSubmit ( ) | ||
loadData ( ) | ||
offsetExists ( $name ) | {{{ ArrayAccess support | |
offsetGet ( $name ) | ||
offsetSet ( $name, $val ) | ||
offsetUnset ( $name ) | ||
onSubmit ( $callback ) | ||
render ( ) | ||
save ( ) | ||
set ( $field_or_array, $value = UNDEFINED ) | * temporarily disabled. TODO: will be implemented with abstract datatype function setSource($table,$db_fields=null){ if(is_null($db_fields)){ $db_fields=array(); foreach($this->elements as $key=>$el){ if(!($el instanceof Form_Field))continue; if($el->no_save)continue; $db_fields[]=$key; } } $this->dq = $this->app->db->dsql() ->table($table) ->field('*',$table) ->limit(1); return $this; } | |
setFieldError ( $field, $name ) | * external error management | |
setLayout ( $template ) | ||
showAjaxError ( object $field, string $msg ) | Should show error in field. Override this method to change form default alert. | |
submitted ( ) | ||
update ( ) | * obsolete in 4.3 - use save() | |
validate ( $rule ) |
메소드 | 설명 | |
---|---|---|
getChunks ( ) |
public set ( $field_or_array, $value = UNDEFINED ) |
public showAjaxError ( object $field, string $msg ) | ||
$field | object | Field instance that caused error |
$msg | string | message to show |
protected array $ajax_submits | ||
리턴 | array |
public array $data | ||
리턴 | array |
public array $errors | ||
리턴 | array |
protected bool $loaded_from_db | ||
리턴 | boolean |
public $search_for_field_spots |
public array $template_chunks | ||
리턴 | array |