My favorites | Sign in
Project Logo
                
Search
for
Updated Mar 16, 2009 by tobiasz.cudnik
formFromVarsMethodPHP  

formFromVars

Wiki > Syntax > formFrom > formFromVars

Parameters

Description

EXPERIMENTAL - works, but not for production code

Method formFromVars acts as flexible form helper. It creates customized exacutable form without the need of suppling a line of markup.

Form code is executed during template-execution and creates final form using record from variable.

Created form have following features:

Created form can be customized using:

Example

 $structure = array(
     '__form' => array('id' => 'myFormId'),
     array(
         '__label' => 'Fieldset 1 legend',
         'default-field' => array(    // 'text' is default
             'label' => 'default-field label',
             'id' => 'default-field-id',
         ),
         'text-field' => array('text',
             'label' => 'text-field label',
             'id' => 'text-field-id',
         ),
         'hidden-field' => 'hidden',
         'checkbox-field' => 'checkbox',
     ),
     array(
         '__label' => 'Fieldset 2 legend',
         'select-field' => array('select',
             'label' => 'select-field label',
         ),
         'select-field-optgroups-multiple' => array('select',
             'label' => 'select-field-optgroups label',
         ),
         'radio-field' => array('radio',
             'values' => array('possibleValue1', 'possibleValue2')
         ),
         'textarea-field' => 'textarea',
     ),
 );

See also

Comments allowed


Sign in to add a comment
Hosted by Google Code