PHP 클래스 Habari\FormContainer

상속: extends FormControl
파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$controls

공개 메소드들

메소드 설명
__get ( string $name ) : FormControl Magic property getter, returns the specified control
__isset ( string $name ) : boolean Magic property isset, returns if the specified control exists
append ( FormControl $control ) : FormControl | FormContainer Append a control to the end of this container
clear ( ) Reset the contained control values to their initial values
control_id ( ) : string Obtain a unique identifier for this control that is the same every time the form is generated
do_success ( FormUI $form ) : boolean | string Calls the success callback for the form, and optionally saves the form values to the options table.
each ( Callable $fn ) Apply a function to every control in this container, and any sub-containers
errors_get ( string $format, string $wrap = '%s' ) : string Return any validation errors on any controls in this container using the supplied format $this->validate must be called first!
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!
get ( Theme $theme ) : string Produce HTML output for all this fieldset and all contained controls
get_contents ( Theme $theme ) : string Get the control contents of this container
get_control ( string $name ) : FormControl | null Get a control from this container by name.
get_controls ( ) : array Returns an associative array of controls
get_value_out ( array $tag_fields ) : boolean | string 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
get_values ( ) : array Returns an associative array of the controls' values
insert ( FormControl $before, FormControl $control ) : FormControl
load ( ) Load this control and its children's initial data from the initialized storage location
move ( FormControl $source, FormControl $target, integer $offset ) 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
move_after ( FormControl $control, FormControl $target ) Moves a control after the target control
move_before ( FormControl $control, FormControl $target ) Moves a control before the target control
move_into ( FormControl $control, FormContainer $target ) Move a control into the container
pre_out ( ) : string Return the HTML/script required for all contained controls. Do it only once.
process ( ) Obtain the value of this control as supplied by the incoming $_POST values
remove ( FormControl $target ) Removes a target control from this group (can be the form or a fieldset)
replace ( FormControl $target, FormControl $control ) Replaces a target control by the supplied control
save ( ) Store each contained control's value under the control's specified key.
set_control_id ( string $control_id ) : FormControl Set the unique identifier for this control.
set_wrap_each ( string $wrap = '%s' ) : FormContainer 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
validate ( ) : array Runs any attached validation functions to check validation of each control contained in this fieldset.

메소드 상세

__get() 공개 메소드

Magic property getter, returns the specified control
public __get ( string $name ) : FormControl
$name string The name of the control
리턴 FormControl The control object requested

__isset() 공개 메소드

Magic property isset, returns if the specified control exists
public __isset ( string $name ) : boolean
$name string The name of the control
리턴 boolean If the control object is set

append() 공개 메소드

Append a control to the end of this container
public append ( FormControl $control ) : FormControl | FormContainer
$control FormControl A control to append to the end of this container
리턴 FormControl | FormContainer The provided FormControl object, fluid

clear() 공개 메소드

Reset the contained control values to their initial values
public clear ( )

control_id() 공개 메소드

Obtain a unique identifier for this control that is the same every time the form is generated
public control_id ( ) : string
리턴 string An md5 hash built using the controls contained within this container

do_success() 공개 메소드

Calls the success callback for the form, and optionally saves the form values to the options table.
public do_success ( FormUI $form ) : boolean | string
$form FormUI The form for which success is being processed
리턴 boolean | string A string to replace the rendering of the form with, or false

each() 공개 메소드

Apply a function to every control in this container, and any sub-containers
public each ( Callable $fn )
$fn Callable A function with the signature (FormControl $control)

errors_get() 공개 메소드

Return any validation errors on any controls in this container using the supplied format $this->validate must be called first!
public errors_get ( string $format, string $wrap = '%s' ) : string
$format string A sprintf()-style format string to format the validation error
$wrap string A sprintf()-style format string to wrap the returned error, only if at least one error exists
리턴 string The errors in the supplied format

errors_out() 공개 메소드

Output any validation errors on any controls in this container using the supplied format $this->validate must be called first!
public errors_out ( $format, $wrap = '%s' )

get() 공개 메소드

Produce HTML output for all this fieldset and all contained controls
public get ( Theme $theme ) : string
$theme Theme The theme used to render the controls
리턴 string HTML that will render this control in the form

get_contents() 공개 메소드

Get the control contents of this container
public get_contents ( Theme $theme ) : string
$theme Theme The theme used to render the controls
리턴 string The requested HTML output

get_control() 공개 메소드

Get a control from this container by name.
public get_control ( string $name ) : FormControl | null
$name string The name of the control
리턴 FormControl | null The control object requested, or null if not found

get_controls() 공개 메소드

Returns an associative array of controls
public get_controls ( ) : array
리턴 array An array of FormControls

get_value_out() 공개 메소드

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
public get_value_out ( array $tag_fields ) : boolean | string
$tag_fields array A list of potential fields to try
리턴 boolean | string False if no value found, string of the property value found

get_values() 공개 메소드

Returns an associative array of the controls' values
public get_values ( ) : array
리턴 array Associative array where key is control's name and value is the control's value

insert() 공개 메소드

public insert ( FormControl $before, FormControl $control ) : FormControl
$before FormControl The control to insert the control in front of
$control FormControl The control to insert
리턴 FormControl $control via Fluent interface

load() 공개 메소드

Load this control and its children's initial data from the initialized storage location
public load ( )

move() 공개 메소드

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
public move ( FormControl $source, FormControl $target, integer $offset )
$source FormControl FormControl object to move
$target FormControl FormControl object acting as destination
$offset integer Integer added to $target's position (index)

move_after() 공개 메소드

Moves a control after the target control
public move_after ( FormControl $control, FormControl $target )
$control FormControl FormControl object to move
$target FormControl FormControl object acting as destination

move_before() 공개 메소드

Moves a control before the target control
public move_before ( FormControl $control, FormControl $target )
$control FormControl FormControl object to move
$target FormControl FormControl object acting as destination

move_into() 공개 메소드

Move a control into the container
public move_into ( FormControl $control, FormContainer $target )
$control FormControl FormControl object to move
$target FormContainer FormContainer object acting as destination

pre_out() 공개 메소드

Return the HTML/script required for all contained controls. Do it only once.
public pre_out ( ) : string
리턴 string The HTML/javascript required for all contained controls.

process() 공개 메소드

Obtain the value of this control as supplied by the incoming $_POST values
public process ( )

remove() 공개 메소드

Removes a target control from this group (can be the form or a fieldset)
public remove ( FormControl $target )
$target FormControl FormControl to remove

replace() 공개 메소드

Replaces a target control by the supplied control
public replace ( FormControl $target, FormControl $control )
$target FormControl FormControl object to replace
$control FormControl FormControl object to replace $target with

save() 공개 메소드

Store each contained control's value under the control's specified key.
public save ( )

set_control_id() 공개 메소드

This DOES NOT set the id attribute of the output HTML for this control!
public set_control_id ( string $control_id ) : FormControl
$control_id string A unique value identifying this control internally
리턴 FormControl $this

set_wrap_each() 공개 메소드

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
public set_wrap_each ( string $wrap = '%s' ) : FormContainer
$wrap string The sprintf-style formatting string
리턴 FormContainer $this

validate() 공개 메소드

Runs any attached validation functions to check validation of each control contained in this fieldset.
public validate ( ) : array
리턴 array An array of string validation error descriptions or an empty array if no errors were found.

프로퍼티 상세

$controls 공개적으로 프로퍼티

public $controls