blueshoes php application framework and cms            core_html
[ class tree: core_html ] [ index: core_html ] [ all elements ]

Procedural File: Bs_FormItAble.class.php

Source Location: /core/html/form/Bs_FormItAble.class.php



Classes:



Page Details:

we had a discussion about the name of this class. "FormItAble" means "form it", with this class you are ABLE to display classes as FORMS., it's about web forms, and the name comes from "formidable". we think this class deserves this name. :-) an alternative would have been "ClassFormHandler". it's a form handler that builds forms for classes.

example: you have a class "car". the car class has the vars carColor, carLength and carSeats. now this class can show a form for these vars. "hint" vars can be used to give more information about the vars and the form.

dataPrefix: by default, the submitted field values will be assigned directly to the class. let's say your class is called $foo, and you have a form field named "bar" then the submitted value will be assigned to $foo->bar. if you want to have it assigned to $foo->data['bar'] instead, you can specify the 'dataPrefix' = 'data' in the hint-hash. if you use groups to separate the fields, you can separate the vars in your class too by specifying the 'dataPrefix' there too, next to the 'caption'. for example:

 	'groups' => array(
 		'grpGeneral' => array(
 			'caption'    => array('en'=>'General', 'de'=>'Allgemein'),
 			'dataPrefix' => 'general',
 		),
 
then a field 'bar' that is in the group 'grpGeneral' will be assigned to $foo->general['bar']. and if you use both, it will be $foo->data['general']['bar']. was that clear?

 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 HINT STRUCTURE:
   The formItAble hint-hash is holding the main info of the class vars that are to be displayed.
   Sample:
      $form_hint_hash = array (
                  'debug'      => array ('checkSopHints'=>TRUE, 'checkHintSyntax'=>TRUE, 'checkClassVars'=>TRUE,
                                        ),
                  'dataPrefix' => string, read above.
            (*)   'props'      => array ( -- All puplic attributes of Bs_Form.class.php / See there. --
                                         ),

                  'groups'     => array ( -- All puplic attributes of Bs_FormContainer.class.php / See there. --
                                         ),
            (*)   'fields'     => array ( -- All puplic attributes of Bs_FormFieldxxxxx.class.php / See there. --
                                         )
      );
   *) Mandatory  \____ ___/           \__________ ____________________________________________________________/
                      V                          V
                  Main Hint Parts       Attributes used to define the form details.

  'debug': (optional)
  ===================
    KEY            | VALUES                | MEANING
  =================+=======================+==============================================================================
  checkSopHints    | { TRUE | FALSE }      | -- not implemented yet -- Default=TRUE - Check the given hint-hash against the given class.
                   | [optional]            | When your certain that types are OK, you may turn this feature off; saving CPU.
                   |                       | See $this->classVarCheck()
  -----------------+-----------------------+------------------------------------------------------------------------------
  checkHintSyntax  | { TRUE | FALSE }      | -- not implemented yet --  Default=TRUE - Check the given hint-hash for syntax error.
                   | [optional]            | When your certain that systax is OK, you may turn this feature off; saving CPU.
                   |                       | See $this->hintsSyntaxCheck()
  -----------------+-----------------------+------------------------------------------------------------------------------
  checkClassVars   | { TRUE | FALSE }      | -- not implemented yet -- Default=TRUE - Check the given hint-hash against the given class.
                   | [optional]            | When your certain that types are OK, you may turn this feature off; saving CPU.
                   |                       | See $this->classVarCheck()
  -----------------+-----------------------+------------------------------------------------------------------------------
 




Tags:

pattern:  singleton
version:  4.5.$Id: Bs_FormItAble.class.php,v 1.10 2003/12/14 09:52:03 andrej Exp $
author:  andrej arn <at blueshoes dot org>, Sam Blum <sam at blueshoes dot org>








Documentation generated on Mon, 29 Dec 2003 21:10:36 +0100 by phpDocumentor 1.2.3