Class

HTMLForm

Package: builder Author: Régis Viarre <crowkait@phpboost.com> Desc: This class enables you to handle all the operations regarding forms. Indeed, you build a form using object components (fieldsets, fields, buttons) and it's able to display, to retrieve the posted values and also validate the entered data from constraints you define. The validation is done in PHP when the form is received, but also in live thanks to Javascript (each field is validated when it looses the focus and the whole form is validated when the user submits it). Located at builder/form/HTMLForm.class.php
HTMLForm implements HTMLElement
Methods summary
public
# __construct( string $html_id, string $target = '', boolean $enable_captcha_protection = true )
public
public
# add_fieldset( FormFieldset $fieldset )
public
# add_constraint( FormConstraint $constraint )
public
# add_button( FormButton $button )
public mixed
# get_value( string $field_id, mixed $default_value = null )
public Boolean
# field_is_disabled( string $field_id )
public mixed
# has_field( string $field_id )
public
# get_field_by_id( mixed $field_id )
public Template
# display( )
public boolean
# validate( )
public
# set_html_id( string $html_id )
public
public
# set_target( string $target )
public
# set_css_class( string $css_class )
public
# set_method( string $method )
public
# set_template( Template $template )
Constants summary
string HTTP_METHOD_POST 'post'
#
string HTTP_METHOD_GET 'get'
#
string SMALL_CSS_CLASS 'fieldset-mini'
#
string NORMAL_CSS_CLASS 'fieldset-content'
#