PHP 클래스 Controller_MVCForm, atk4
In most cases the following use is sufficient
$form->setModel('SomeModel');
If you want to import fields from multiple models, you can use this:
$ctl = $form->importFields($model,array('name','surname');
and if you want to use your own class based on this one, syntax is:
$ctl = $form->add('Controller_MVCForm_Derived')->importFields($model,array('name','surname'));
You can subsequently call importField() to add additional fields such as:
$form_field = $ctl->importField('age');
which will return newly added form field.
파일 보기
프로젝트 열기: atk4/atk4
1 사용 예제들
공개 프로퍼티들
공개 메소드들
메소드 상세
Redefine this method to add special handling of your own fields.
Returns array of models model_name => Model used in this form.
Import one field from model into form.
Use $fields === false if you want to associate form with model, but don't create form fields.
Import model fields in form.
Copies model field values into form.
public update ( Form $form ) |
$form |
Form |
|
프로퍼티 상세
$field_associations 공개적으로 프로퍼티
Field associations form_field => model_field
public array $field_associations |
리턴 |
array |
|
public Model $model |
리턴 |
Model |
|
public Form $owner |
리턴 |
Form |
|
$type_associations 공개적으로 프로퍼티
Field type associations model_field_type => form_field_type
public array $type_associations |
리턴 |
array |
|