Public Member Functions | Public Attributes

FormContainer Class Reference

Inheritance diagram for FormContainer:
Collaboration diagram for FormContainer:

List of all members.

Public Member Functions

 append ($control)
 insert ($before, $control)
 set_control_id ($control_id)
 set_wrap_each ($wrap= '%s')
 get_values ()
 get_controls ()
 get (Theme $theme)
 move (FormControl $source, FormControl $target, $offset=0)
 move_before (FormControl $control, FormControl $target)
 move_after (FormControl $control, FormControl $target)
 move_into (FormControl $control, FormContainer $target)
 replace (FormControl $target, FormControl $control)
 remove (FormControl $target)
 __get ($name)
 get_control ($name)
 __isset ($name)
 errors_out ($format, $wrap= '%s')
 errors_get ($format, $wrap= '%s')
 get_value_out ($tag_fields)
 each ($fn)
 clear ()

Public Attributes

 $controls = array()

Detailed Description

Definition at line 5 of file formcontainer.php.


Member Function Documentation

FormContainer::__get ( name  ) 

Magic property getter, returns the specified control

Parameters:
string $name The name of the control
Returns:
FormControl The control object requested

Definition at line 274 of file formcontainer.php.

FormContainer::__isset ( name  ) 

Magic property isset, returns if the specified control exists

Parameters:
string $name The name of the control
Returns:
bool If the control object is set

Definition at line 306 of file formcontainer.php.

FormContainer::append ( control  ) 

Append a control to the end of this container

Parameters:
FormControl $control A control to append to the end of this container
Returns:
FormControl|FormContainer The provided FormControl object, fluid

Definition at line 16 of file formcontainer.php.

Referenced by AdminUsersHandler::__construct(), AdminGroupsHandler::__construct(), Post::comment_form(), Menus::filter_menu_type_data(), and insert().

FormContainer::clear (  ) 

Reset the contained control values to their initial values

Reimplemented from FormControl.

Definition at line 474 of file formcontainer.php.

Referenced by AdminGroupsHandler::do_add_group(), and AdminUsersHandler::do_add_user().

FormContainer::each ( fn  ) 

Apply a function to every control in this container, and any sub-containers

Parameters:
Callable $fn A function with the signature (FormControl $control)

Definition at line 462 of file formcontainer.php.

Referenced by clear(), FormUI::dupe(), FormControlRepeater::get(), FormUI::get(), and FormControlDropbutton::pre_out().

FormContainer::errors_get ( format,
wrap = '%s' 
)

Return any validation errors on any controls in this container using the supplied format $this->validate must be called first!

Parameters:
string $format A sprintf()-style format string to format the validation error
string $wrap A sprintf()-style format string to wrap the returned error, only if at least one error exists
Returns:
string The errors in the supplied format

Definition at line 426 of file formcontainer.php.

Referenced by errors_out().

FormContainer::errors_out ( format,
wrap = '%s' 
)

Output any validation errors on any controls in this container using the supplied format $this->validate must be called first!

string $format A sprintf()-style format string to format the validation error string $format A sprintf()-style format string to wrap the returned error, only if at least one error exists

Definition at line 413 of file formcontainer.php.

FormContainer::get ( Theme theme  ) 

Produce HTML output for all this fieldset and all contained controls

Parameters:
Theme $theme The theme used to render the controls
Returns:
string HTML that will render this control in the form

Reimplemented from FormControl.

Reimplemented in FormControlFieldset, FormControlLabel, FormControlRepeater, FormControlTabs, and FormControlWrapper.

Definition at line 161 of file formcontainer.php.

FormContainer::get_control ( name  ) 

Get a control from this container by name.

Parameters:
string $name The name of the control
Returns:
FormControl|null The control object requested, or null if not found

Definition at line 284 of file formcontainer.php.

Referenced by __get().

FormContainer::get_controls (  ) 

Returns an associative array of controls

Returns:
array An array of FormControls

Definition at line 114 of file formcontainer.php.

Referenced by errors_get().

FormContainer::get_value_out ( tag_fields  ) 

Return the property value that is associated with the first present property from an array list This version only searches the list of the class' $properties array, because __get() on this objcet returns named FormControls instances

Parameters:
array $tag_fields A list of potential fields to try
Returns:
bool|string False if no value found, string of the property value found

Definition at line 446 of file formcontainer.php.

FormContainer::get_values (  ) 

Returns an associative array of the controls' values

Returns:
array Associative array where key is control's name and value is the control's value

Definition at line 95 of file formcontainer.php.

Referenced by FormUI::bounce(), and FormUI::post_redirect().

FormContainer::insert ( before,
control 
)
Parameters:
FormControl $before The control to insert the control in front of
FormControl $control The control to insert
Returns:
FormControl $control via Fluent interface

Definition at line 32 of file formcontainer.php.

FormContainer::move ( FormControl source,
FormControl target,
offset = 0 
)

Moves a control to target's position to which we add $int if specified That integer is useful to move before or move after the target

Parameters:
FormControl $source FormControl object to move
FormControl $target FormControl object acting as destination
int $offset Integer added to $target's position (index)

Definition at line 178 of file formcontainer.php.

Referenced by move_after(), and move_before().

FormContainer::move_after ( FormControl control,
FormControl target 
)

Moves a control after the target control

Parameters:
FormControl $control FormControl object to move
FormControl $target FormControl object acting as destination

Definition at line 219 of file formcontainer.php.

Referenced by replace().

FormContainer::move_before ( FormControl control,
FormControl target 
)

Moves a control before the target control

Parameters:
FormControl $control FormControl object to move
FormControl $target FormControl object acting as destination

Definition at line 208 of file formcontainer.php.

Referenced by insert().

FormContainer::move_into ( FormControl control,
FormContainer target 
)

Move a control into the container

Parameters:
FormControl $control FormControl object to move
FormContainer $target FormContainer object acting as destination

Definition at line 230 of file formcontainer.php.

FormContainer::remove ( FormControl target  ) 

Removes a target control from this group (can be the form or a fieldset)

Parameters:
FormControl $target FormControl to remove

Definition at line 262 of file formcontainer.php.

FormContainer::replace ( FormControl target,
FormControl control 
)

Replaces a target control by the supplied control

Parameters:
FormControl $target FormControl object to replace
FormControl $control FormControl object to replace $target with

Definition at line 251 of file formcontainer.php.

FormContainer::set_control_id ( control_id  ) 

Set the unique identifier for this control. This DOES NOT set the id attribute of the output HTML for this control!

Parameters:
string $control_id A unique value identifying this control internally
Returns:
FormControl $this

Definition at line 72 of file formcontainer.php.

FormContainer::set_wrap_each ( wrap = '%s'  ) 

Set a sprintf-style string that will wrap each control within this container with markup Use to create, for example,

s

for each control in the container

Parameters:
string $wrap The sprintf-style formatting string
Returns:
FormContainer $this

Definition at line 84 of file formcontainer.php.

Referenced by Post::comment_form().


The documentation for this class was generated from the following file: