PHP 클래스 Backend\Core\Engine\Form

저자: Davy Hellemans ([email protected])
저자: Tijs Verkoyen ([email protected])
상속: extends Common\Core\Form
파일 보기 프로젝트 열기: forkcms/forkcms 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $name = null, string $action = null, string $method = 'post', boolean $useToken = true, boolean $useGlobalError = true )
addButton ( string $name, string $value, string $type = 'submit', string $class = null ) : SpoonFormButton Adds a button to the form
addDate ( string $name, mixed $value = null, string $type = null, integer $date = null, integer $date2 = null, string $class = null, string $classError = null ) : FormDate Adds a datefield to the form
addEditor ( string $name, string $value = null, string $class = null, string $classError = null, boolean $HTML = true ) : SpoonFormTextarea Add an editor field
addFile ( string $name, string $class = null, string $classError = null ) : SpoonFormFile Adds a single file field.
addImage ( string $name, string $class = null, string $classError = null ) : FormImage Adds a single image field.
getValues ( mixed $excluded = ['form', 'save', 'form_token', '_utf8'] ) : array Fetches all the values for this form as key/value pairs
isCorrect ( boolean $revalidate = true ) : boolean Checks to see if this form has been correctly submitted. Will revalidate by default.
parse ( TwigTemplate $tpl ) Parse the form

메소드 상세

__construct() 공개 메소드

public __construct ( string $name = null, string $action = null, string $method = 'post', boolean $useToken = true, boolean $useGlobalError = true )
$name string Name of the form.
$action string The action (URL) whereto the form will be submitted, if not provided it will be autogenerated.
$method string The method to use when submitting the form, default is POST.
$useToken boolean Should we automagically add a formtoken?
$useGlobalError boolean Should we automagically show a global error?

addButton() 공개 메소드

Adds a button to the form
public addButton ( string $name, string $value, string $type = 'submit', string $class = null ) : SpoonFormButton
$name string Name of the button.
$value string The value (or label) that will be printed.
$type string The type of the button (submit is default).
$class string Class(es) that will be applied on the button.
리턴 SpoonFormButton

addDate() 공개 메소드

Adds a datefield to the form
public addDate ( string $name, mixed $value = null, string $type = null, integer $date = null, integer $date2 = null, string $class = null, string $classError = null ) : FormDate
$name string Name of the element.
$value mixed The value for the element.
$type string The type (from, till, range) of the datepicker.
$date integer The date to use.
$date2 integer The second date for a rangepicker.
$class string Class(es) that have to be applied on the element.
$classError string Class(es) that have to be applied when an error occurs on the element.
리턴 FormDate

addEditor() 공개 메소드

Add an editor field
public addEditor ( string $name, string $value = null, string $class = null, string $classError = null, boolean $HTML = true ) : SpoonFormTextarea
$name string The name of the element.
$value string The value inside the element.
$class string Class(es) that will be applied on the element.
$classError string Class(es) that will be applied on the element when an error occurs.
$HTML boolean Will the field contain HTML?
리턴 SpoonFormTextarea

addFile() 공개 메소드

Adds a single file field.
public addFile ( string $name, string $class = null, string $classError = null ) : SpoonFormFile
$name string Name of the element.
$class string Class(es) that will be applied on the element.
$classError string Class(es) that will be applied on the element when an error occurs.
리턴 SpoonFormFile

addImage() 공개 메소드

Adds a single image field.
public addImage ( string $name, string $class = null, string $classError = null ) : FormImage
$name string The name of the element.
$class string Class(es) that will be applied on the element.
$classError string Class(es) that will be applied on the element when an error occurs.
리턴 FormImage

getValues() 공개 메소드

Fetches all the values for this form as key/value pairs
public getValues ( mixed $excluded = ['form', 'save', 'form_token', '_utf8'] ) : array
$excluded mixed Which elements should be excluded?
리턴 array

isCorrect() 공개 메소드

Checks to see if this form has been correctly submitted. Will revalidate by default.
public isCorrect ( boolean $revalidate = true ) : boolean
$revalidate boolean Do we need to enforce validation again, even if it might already been done before?
리턴 boolean

parse() 공개 메소드

Parse the form
public parse ( TwigTemplate $tpl )
$tpl TwigTemplate The template instance wherein the form will be parsed.