Agile Toolkit  4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
Form_Basic Class Reference
Inheritance diagram for Form_Basic:
View AbstractView AbstractObject Form Filter MVCForm QuickSearch

Public Member Functions

 init ()
 initializeTemplate ($tag, $template)
 defaultTemplate ($template=null, $tag=null)
 grabTemplateChunk ($name)
 showAjaxError ($field, $msg)
 displayError ($field=null, $msg=null)
 addField ($type, $name, $caption=null, $attr=null)
 disable ()
 importFields ($model, $fields=undefined)
 addComment ($comment)
 addSeparator ($fieldset_class='')
 get ($field=null)
 setSource ($table, $db_fields=null)
 set ($field_or_array, $value=undefined)
 getAllFields ()
 addSubmit ($label='Save', $name=null, $color=null)
 addButton ($label)
 setConditionFromGET ($field='id', $get_field=null)
 addConditionFromGET ($field='id', $get_field=null)
 addCondition ($field, $value=null)
 loadData ()
 isLoadedFromDB ()
 update ()
 submitted ()
 lateSubmit ()
 isSubmitted ()
 onSubmit ($callback)
 setLayout ($template)
 setFormClass ($class)
 render ()
 hasField ($name)
 isClicked ($name)
 setFieldError ($field, $name)

Data Fields

 $errors = array()
 $template_chunks = array()
 $data = array()
 $bail_out = null
 $onsubmit = null
 $onload = null
 $js_widget = 'ui.atk4_form'
 $js_widget_arguments = array()
 $default_exception = 'Exception_ValidityCheck'
 $default_controller = 'MVCForm'
 $dq = null

Protected Member Functions

 getChunks ()

Protected Attributes

 $form_template = null
 $form_tag = null
 $loaded_from_db = false
 $ajax_submits = array()
 $get_field = null
 $conditions = array()

Detailed Description

This class implements generic form, which you can actually use without redeclaring it. Just add fields, buttons and use execute method.

Romans <>

Member Function Documentation

addButton ( label)
addComment ( comment)
addCondition ( field,
value = null 
addConditionFromGET ( field = 'id',
get_field = null 
addField ( type,
caption = null,
attr = null 
addSeparator ( fieldset_class = '')
addSubmit ( label = 'Save',
name = null,
color = null 
defaultTemplate ( template = null,
tag = null 
disable ( )
displayError ( field = null,
msg = null 
get ( field = null)
getChunks ( ) [protected]
grabTemplateChunk ( name)
hasField ( name)
importFields ( model,
fields = undefined 
init ( )

Initialize object. Always call parent

During form initialization it will go through it's own template and search for lots of small template chunks it will be using. If those chunk won't be in template, it will fall back to default values. This way you can re-define how form will look, but only what you need in particular case. If you don't specify template at all, form will work with default look.

This method is called for initialization

Reimplemented from AbstractObject.

Reimplemented in QuickSearch, and Filter.

initializeTemplate ( tag,

Reimplemented from AbstractView.

isClicked ( name)
loadData ( )

This call will be sent to fields, and they will initialize their values from $this->data

onSubmit ( callback)
render ( )

Default render. Generates HTML presentation of the view based on $this->template and passes it to output() function which then inserts output into parent's template

For visual objects, their default action while rendering is rely on SMlite engine. For sake of simplicity and speed you can redefine this method with a simple call

Reimplemented from AbstractView.

set ( field_or_array,
value = undefined 
setConditionFromGET ( field = 'id',
get_field = null 
setFieldError ( field,
setFormClass ( class)
setLayout ( template)
setSource ( table,
db_fields = null 
showAjaxError ( field,

Should show error in field. Override this method to change from default alert

object$fieldField instance that caused error
string$msgmessage to show
submitted ( )

Default down-call submitted will automatically call this method if form was submitted

Reimplemented in Filter.

update ( )

Field Documentation

$ajax_submits = array() [protected]
$bail_out = null
$conditions = array() [protected]
$data = array()
$default_controller = 'MVCForm'

When using setModel() with Views some views will want to populate fields, columns etc corresponding to models meta-data. That is the job of Controller. When you create a custom controller for your view set this property to point at your controller and it will be used automatically

Reimplemented from AbstractView.

$default_exception = 'Exception_ValidityCheck'

Exception class to use when $this->exception() is called

Reimplemented from AbstractObject.

$dq = null
$errors = array()
$form_tag = null [protected]
$form_template = null [protected]
$get_field = null [protected]
$js_widget = 'ui.atk4_form'

Reimplemented in QuickSearch.

$js_widget_arguments = array()
$loaded_from_db = false [protected]
$onload = null
$onsubmit = null
$template_chunks = array()

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations