PHP 클래스 Habari\FormUI

For a list of options to customize its output or behavior see FormUI::set_option()
상속: extends FormContainer, implements IsContent
파일 보기 프로젝트 열기: habari/system 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dom
$formtype
$properties
$registered_forms
$submitted
$success
$success_render If this is not false, this value should be rendered instead of the form as a success response

공개 메소드들

메소드 설명
__construct ( string $name, string $formtype = null, array $extra_data = [] ) FormUI's constructor, called on instantiation.
__toString ( ) : string Convert this object instance to a string
bounce ( $keep_hash = true ) Redirect the user back to the stored URL value in session
build ( string $name, string $formtype = null, array $extra_data = [] ) : FormUI Create a new instance of this class and return it, use the fluent interface
content_type ( ) : array Implementation of IsContent
dupe ( Theme $theme = null ) : string Produce a form "duplicate" that does not process the form, display output, or include one-time-javascripts
from_html ( string $name, string $html ) : FormUI Create a form with controls from HTML
get ( Theme $theme = null ) : string Produce a form with the contained fields.
get_id_component ( ) : string Get a string that will be used to generate a component of a control's HTML id
has_session_data ( ) : boolean Get whether there is session data stored for this form
media_panel ( string $path, string $panel, string $callback ) Configure all the options necessary to make this form work inside a media bar panel
out ( ) Output a form with the contained fields.
output_controls ( Theme $theme ) : string Return the form control HTML.
post_redirect ( string $url = null ) : string Process a form, then redirect, saving control values on errors for redisplay
pre_out_controls ( ) : string Return pre-output control configuration scripts for any controls that require them.
register ( string $name, Callable $build_callback ) Register a function to use to create a new form
set_from_error_values ( ) Set the values of the form controls from their session error values, if stored
simulate ( array $data, boolean $do_wsse_and_id = false ) Simulate posting data to this form

메소드 상세

__construct() 공개 메소드

FormUI's constructor, called on instantiation.
public __construct ( string $name, string $formtype = null, array $extra_data = [] )
$name string The name of the form, used to differentiate multiple forms.
$formtype string The type of the form, used to classify form types for plugin modification
$extra_data array An array of extra data that can be passed into the form

__toString() 공개 메소드

Convert this object instance to a string
public __toString ( ) : string
리턴 string The form as HTML

bounce() 공개 메소드

Redirect the user back to the stored URL value in session
public bounce ( $keep_hash = true )

build() 공개 정적인 메소드

Create a new instance of this class and return it, use the fluent interface
public static build ( string $name, string $formtype = null, array $extra_data = [] ) : FormUI
$name string The name of the form to build
$formtype string The type of the form
$extra_data array Extra data to pass to the form for configuration purposes
리턴 FormUI The instance of the created form

content_type() 공개 메소드

Implementation of IsContent
public content_type ( ) : array
리턴 array An array of content types that this object represents, starting with the most specific

dupe() 공개 메소드

Produce a form "duplicate" that does not process the form, display output, or include one-time-javascripts
public dupe ( Theme $theme = null ) : string
$theme Theme The theme to render the controls into
리턴 string HTML form generated from all controls assigned to this form

from_html() 공개 정적인 메소드

Create a form with controls from HTML
public static from_html ( string $name, string $html ) : FormUI
$name string Name of the form
$html string HTML of a form
리턴 FormUI The form created from the supplied HTML

get() 공개 메소드

Produce a form with the contained fields.
public get ( Theme $theme = null ) : string
$theme Theme The theme to render the controls into
리턴 string HTML form generated from all controls assigned to this form

get_id_component() 공개 메소드

Get a string that will be used to generate a component of a control's HTML id
public get_id_component ( ) : string
리턴 string

has_session_data() 공개 메소드

Get whether there is session data stored for this form
public has_session_data ( ) : boolean
리턴 boolean True if this form has session data set

media_panel() 공개 메소드

Configure all the options necessary to make this form work inside a media bar panel
public media_panel ( string $path, string $panel, string $callback )
$path string Identifies the silo
$panel string The panel in the silo to submit to
$callback string Javascript function to call on form submission

out() 공개 메소드

Calls $this->get() and echoes.
public out ( )

output_controls() 공개 메소드

Return the form control HTML.
public output_controls ( Theme $theme ) : string
$theme Theme The theme used to render the controls
리턴 string The output of controls' HTML.

post_redirect() 공개 메소드

Process a form, then redirect, saving control values on errors for redisplay
public post_redirect ( string $url = null ) : string
$url string The URL to redirect to, presumably with the original form on it
리턴 string The form output, if needed

pre_out_controls() 공개 메소드

Return pre-output control configuration scripts for any controls that require them.
public pre_out_controls ( ) : string
리턴 string The output of controls' pre-output HTML.

register() 공개 정적인 메소드

Register a function to use to create a new form
public static register ( string $name, Callable $build_callback )
$name string The name of the form to register
$build_callback Callable The method to call to customize a form instance (FormUI $form, string $name, string $form_type)

set_from_error_values() 공개 메소드

Set the values of the form controls from their session error values, if stored

simulate() 공개 메소드

Simulate posting data to this form
public simulate ( array $data, boolean $do_wsse_and_id = false )
$data array An associative array of data to simultae adding to the $_POST array
$do_wsse_and_id boolean Default is false. If true, add this form's id and correct WSSE values to the $_POST array

프로퍼티 상세

$dom 공개적으로 프로퍼티

public $dom

$formtype 공개적으로 프로퍼티

public $formtype

$properties 공개적으로 프로퍼티

public $properties

$registered_forms 공개적으로 정적으로 프로퍼티

public static $registered_forms

$submitted 공개적으로 프로퍼티

public $submitted

$success 공개적으로 프로퍼티

public $success

$success_render 공개적으로 프로퍼티

If this is not false, this value should be rendered instead of the form as a success response
public $success_render