PHP Class Form_Field, atk4

Author: Romans ([email protected])
Inheritance: extends AbstractView
ファイルを表示 Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$_icon Layout changes in response to adding more elements before / after
$_use_cells Will enable field wrappin inside a atk-cells/atk-cell block
$app App_Web
$attr
$button_append
$button_prepend
$caption template used to mark mandatory fields
$comment
$default_value
$error_template Description of the field shown next to it on the form.
$form
$mandatory_template template used to put errors on the field line
$no_save
$readonly
$short_name use $this->get(), ->set().
$show_input_only

Protected Properties

Property Type Description
$disabled
$mandatory
$value

Public Methods

Method Description
_cutField ( )
_validateField ( $caller, $condition, $msg )
_validateNotNull ( $field )
aboveField ( ) : View
addButton ( $label, $options = [] ) Position can be either 'before' or 'after'
addClass ( $class )
addComment ( $text = '' )
addIcon ( $icon, $link = null ) Wraps input field into a to align icon correctly
afterField ( ) : View
beforeField ( ) : View
belowField ( ) : View
defaultTemplate ( )
destroy ( )
disable ( )
displayFieldError ( $msg = null )
get ( )
getInput ( $attr = [] )
getTag ( $tag, $attr = null, $value = null )
init ( ) }}}
isDisabled ( )
isMandatory ( )
loadPOST ( )
normalize ( )
performValidation ( ) Used to be called validate(), this method is called when field should do some of it's basic validation done.
render ( )
set ( $value )
setAttr ( $attr, $value = UNDEFINED )
setCaption ( $_caption )
setClass ( $class )
setComment ( $text = '' )
setFieldHint ( $var_args = null )
setForm ( $form )
setMandatory ( $mandatory = true )
setNoSave ( )
setProperty ( $property, $value ) synonym, setAttr is preferred
setReadonly ( $readonly = true )
setSeparator ( $separator )
validate ( $rule = null ) This method has been refactored to integrate with Controller_Validator.
validateField ( $condition, $msg = null ) Executes a callback. If callback returns string, shows it as error message.
validateNotNULL ( $msg = null ) Adds "X is a mandatory field" message

Method Details

_cutField() public method

public _cutField ( )

_validateField() public method

public _validateField ( $caller, $condition, $msg )

_validateNotNull() public method

public _validateNotNull ( $field )

aboveField() public method

public aboveField ( ) : View
return View

addButton() public method

Position can be either 'before' or 'after'
public addButton ( $label, $options = [] )

addClass() public method

public addClass ( $class )

addComment() public method

public addComment ( $text = '' )

addIcon() public method

Wraps input field into a to align icon correctly
public addIcon ( $icon, $link = null )

afterField() public method

public afterField ( ) : View
return View

beforeField() public method

public beforeField ( ) : View
return View

belowField() public method

public belowField ( ) : View
return View

defaultTemplate() public method

public defaultTemplate ( )

destroy() public method

public destroy ( )

disable() public method

public disable ( )

displayFieldError() public method

public displayFieldError ( $msg = null )

get() public method

public get ( )

getInput() public method

public getInput ( $attr = [] )

getTag() public method

public getTag ( $tag, $attr = null, $value = null )

init() public method

}}}
public init ( )

isDisabled() public method

public isDisabled ( )

isMandatory() public method

public isMandatory ( )

loadPOST() public method

public loadPOST ( )

normalize() public method

public normalize ( )

performValidation() public method

Used to be called validate(), this method is called when field should do some of it's basic validation done.
public performValidation ( )

render() public method

public render ( )

set() public method

public set ( $value )

setAttr() public method

public setAttr ( $attr, $value = UNDEFINED )

setCaption() public method

public setCaption ( $_caption )

setClass() public method

public setClass ( $class )

setComment() public method

public setComment ( $text = '' )

setFieldHint() public method

public setFieldHint ( $var_args = null )

setForm() public method

public setForm ( $form )

setMandatory() public method

public setMandatory ( $mandatory = true )

setNoSave() public method

public setNoSave ( )

setProperty() public method

synonym, setAttr is preferred
public setProperty ( $property, $value )

setReadonly() public method

public setReadonly ( $readonly = true )

setSeparator() public method

public setSeparator ( $separator )

validate() public method

This method has been refactored to integrate with Controller_Validator.
public validate ( $rule = null )

validateField() public method

If callback returns "false" shows either $msg or a standard error message. about field being incorrect
public validateField ( $condition, $msg = null )

validateNotNULL() public method

Adds "X is a mandatory field" message
public validateNotNULL ( $msg = null )

Property Details

$_icon public_oe property

Layout changes in response to adding more elements before / after
public $_icon

$_use_cells public_oe property

Will enable field wrappin inside a atk-cells/atk-cell block
public $_use_cells

$app public_oe property

public App_Web $app
return App_Web

$attr public_oe property

public $attr

$button_append public_oe property

public $button_append

$button_prepend public_oe property

public $button_prepend

$caption public_oe property

template used to mark mandatory fields
public $caption

$comment public_oe property

public $comment

$default_value public_oe property

public $default_value

$disabled protected_oe property

protected $disabled

$error_template public_oe property

Description of the field shown next to it on the form.
public $error_template

$form public_oe property

public $form

$mandatory protected_oe property

protected $mandatory

$mandatory_template public_oe property

template used to put errors on the field line
public $mandatory_template

$no_save public_oe property

public $no_save

$readonly public_oe property

public $readonly

$short_name public_oe property

use $this->get(), ->set().
public $short_name

$show_input_only public_oe property

public $show_input_only

$value protected_oe property

protected $value