PHP 클래스 FOF30\Form\Form

부터: 2.0
상속: extends JFor\JForm
파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$container FOF30\Container\Container The Container this form belongs to
$entities array Prototypes for all fields and rules are here. Array's structure: entities: {ENTITY_NAME}: {KEY}: {OBJECT}
$model FOF30\Model\DataModel The model attached to this view
$view FOF30\View\DataView\DataViewInterface The view used to render this form

공개 메소드들

메소드 설명
__construct ( Container $container, string $name, array $options = [] ) Method to instantiate the form object.
addFieldPath ( string $new = null ) : void WARNING: THIS IS IGNORED IN FOF3!
addFormPath ( string $new = null ) : void WARNING: THIS IS IGNORED IN FOF3!
addHeaderPath ( string $new = null ) : void WARNING: THIS IS IGNORED IN FOF3!
addRulePath ( string $new = null ) : void WARNING: THIS IS IGNORED IN FOF3!
bind ( mixed $data ) : boolean Method to bind data to the form.
getAttribute ( string $attribute, mixed $default = null ) : mixed Returns the value of an attribute of the form itself
getContainer ( ) : Container Get a reference to the form's Container
getData ( ) : JRegistry Returns a reference to the protected $data object, allowing direct access to and manipulation of the form's data.
getHeader ( string $name, string $group = null, mixed $value = null ) : FOF30\Form\HeaderInterface | boolean Method to get a header field represented as a HeaderInterface object.
getHeaderset ( ) : array Method to get an array of FormHeader objects in the headerset.
getModel ( ) : DataModel Returns the DataModel attached to this form
getView ( ) : FOF30\View\DataView\DataViewInterface Returns the DataViewInterface attached to this form
loadCSSFiles ( ) : void Loads the CSS files defined in the form, based on its cssfiles attribute
loadClass ( string $entity, string $type ) : mixed Load a class for one of the form's entities of a particular type.
loadFile ( string $file, boolean $reset = true, boolean $xpath = false ) : boolean Method to load the form description from an XML file.
loadJSFiles ( ) : void Loads the Javascript files defined in the form, based on its jsfiles attribute
removeHeader ( string $name, string $group = null ) : boolean Method to remove a header from the form definition.
setContainer ( Container $container ) Set the form's Container
setModel ( DataModel &$model ) : void Attaches a DataModel to this form
setView ( FOF30\View\DataView\DataViewInterface &$view ) : void Attaches a DataViewInterface to this form

보호된 메소드들

메소드 설명
bindLevel ( string $group, mixed $data ) : void Method to bind data to the form for the group level.
findField ( string $name, string $group = null ) : mixed Method to get a form field represented as an XML element object.
findHeader ( string $name, string $group = null ) : mixed Method to get a header field represented as an XML element object.
findHeadersByGroup ( mixed $group = null, boolean $nested = false ) : SimpleXMLElement | boolean Method to get an array of
elements from the form XML document which are in a control group by name.
loadField ( string $element, string $group = null, mixed $value = null ) : mixed Method to load, setup and return a JFormField object based on field data.
loadFieldType ( string $type, boolean $new = true ) : FOF30\Form\FieldInterface | boolean Proxy for {@link Helper::loadFieldType()}.
loadHeader ( string $element, string $group = null ) : FOF30\Form\HeaderInterface | boolean Method to load, setup and return a HeaderInterface object based on field data.
loadHeaderType ( string $type, boolean $new = true ) : FOF30\Form\HeaderInterface | boolean Proxy for {@link Helper::loadHeaderType()}.
loadRuleType ( string $type, boolean $new = true ) : JFormRule | boolean Proxy for {@link Helper::loadRuleType()}.
loadType ( string $entity, string $type, boolean $new = true ) : mixed Method to load a form entity object given a type.
modelToBindSource ( DataModel $model, integer $maxLevel = 1, array $modelsProcessed = [] ) : array Converts a DataModel into data suitable for use with the form. The difference to the Model's getData() method is that we process hasOne and belongsTo relations. This is a recursive function which will be called at most $maxLevel deep. You can set this in the form XML file, in the relation_depth attribute.

메소드 상세

__construct() 공개 메소드

Method to instantiate the form object.
public __construct ( Container $container, string $name, array $options = [] )
$container FOF30\Container\Container The component Container where this form belongs to
$name string The name of the form.
$options array An array of form options.

addFieldPath() 공개 정적인 메소드

WARNING: THIS IS IGNORED IN FOF3!
사용 중단: 3.0
public static addFieldPath ( string $new = null ) : void
$new string IGNORED!
리턴 void

addFormPath() 공개 정적인 메소드

WARNING: THIS IS IGNORED IN FOF3!
사용 중단: 3.0
public static addFormPath ( string $new = null ) : void
$new string IGNORED!
리턴 void

addHeaderPath() 공개 정적인 메소드

WARNING: THIS IS IGNORED IN FOF3!
사용 중단: 3.0
public static addHeaderPath ( string $new = null ) : void
$new string IGNORED!
리턴 void

addRulePath() 공개 정적인 메소드

WARNING: THIS IS IGNORED IN FOF3!
사용 중단: 3.0
public static addRulePath ( string $new = null ) : void
$new string IGNORED!
리턴 void

bind() 공개 메소드

Method to bind data to the form.
부터: 11.1
public bind ( mixed $data ) : boolean
$data mixed An array or object of data to bind to the form.
리턴 boolean True on success.

bindLevel() 보호된 메소드

Method to bind data to the form for the group level.
부터: 11.1
protected bindLevel ( string $group, mixed $data ) : void
$group string The dot-separated form group path on which to bind the data.
$data mixed An array or object of data to bind to the form for the group level.
리턴 void

findField() 보호된 메소드

Method to get a form field represented as an XML element object.
부터: 11.1
protected findField ( string $name, string $group = null ) : mixed
$name string The name of the form field.
$group string The optional dot-separated form group path on which to find the field.
리턴 mixed The XML element object for the field or boolean false on error.

findHeader() 보호된 메소드

Method to get a header field represented as an XML element object.
부터: 2.0
protected findHeader ( string $name, string $group = null ) : mixed
$name string The name of the form field.
$group string The optional dot-separated form group path on which to find the field.
리턴 mixed The XML element object for the field or boolean false on error.

findHeadersByGroup() 보호된 메소드

Method to get an array of
elements from the form XML document which are in a control group by name.
부터: 2.0
protected findHeadersByGroup ( mixed $group = null, boolean $nested = false ) : SimpleXMLElement | boolean
$group mixed The optional dot-separated form group path on which to find the fields. Null will return all fields. False will return fields not in a group.
$nested boolean True to also include fields in nested groups that are inside of the group for which to find fields.
리턴 SimpleXMLElement | boolean Boolean false on error or array of SimpleXMLElement objects.

getAttribute() 공개 메소드

Returns the value of an attribute of the form itself
부터: 2.0
public getAttribute ( string $attribute, mixed $default = null ) : mixed
$attribute string The name of the attribute
$default mixed Optional default value to return
리턴 mixed

getContainer() 공개 메소드

Get a reference to the form's Container
public getContainer ( ) : Container
리턴 FOF30\Container\Container

getData() 공개 메소드

Returns a reference to the protected $data object, allowing direct access to and manipulation of the form's data.
부터: 2.0
public getData ( ) : JRegistry
리턴 JRegistry The form's data registry

getHeader() 공개 메소드

Method to get a header field represented as a HeaderInterface object.
부터: 2.0
public getHeader ( string $name, string $group = null, mixed $value = null ) : FOF30\Form\HeaderInterface | boolean
$name string The name of the header field.
$group string The optional dot-separated form group path on which to find the field.
$value mixed The optional value to use as the default for the field. (DEPRECATED)
리턴 FOF30\Form\HeaderInterface | boolean The HeaderInterface object for the field or boolean false on error.

getHeaderset() 공개 메소드

Method to get an array of FormHeader objects in the headerset.
부터: 2.0
public getHeaderset ( ) : array
리턴 array The array of HeaderInterface objects in the headerset.

getModel() 공개 메소드

Returns the DataModel attached to this form
public getModel ( ) : DataModel
리턴 FOF30\Model\DataModel

getView() 공개 메소드

Returns the DataViewInterface attached to this form
public getView ( ) : FOF30\View\DataView\DataViewInterface
리턴 FOF30\View\DataView\DataViewInterface

loadCSSFiles() 공개 메소드

Loads the CSS files defined in the form, based on its cssfiles attribute
부터: 2.0
public loadCSSFiles ( ) : void
리턴 void

loadClass() 공개 메소드

Currently, it makes sense to use this method for the "field" and "rule" entities (but you can support more entities in your subclass).
부터: 2.0
public loadClass ( string $entity, string $type ) : mixed
$entity string One of the form entities (field, header or rule).
$type string Type of an entity.
리턴 mixed Class name on success or false otherwise.

loadField() 보호된 메소드

Method to load, setup and return a JFormField object based on field data.
부터: 11.1
protected loadField ( string $element, string $group = null, mixed $value = null ) : mixed
$element string The XML element object representation of the form field.
$group string The optional dot-separated form group path on which to find the field.
$value mixed The optional value to use as the default for the field.
리턴 mixed The JFormField object for the field or boolean false on error.

loadFieldType() 보호된 메소드

Proxy for {@link Helper::loadFieldType()}.
부터: 2.0
protected loadFieldType ( string $type, boolean $new = true ) : FOF30\Form\FieldInterface | boolean
$type string The field type.
$new boolean Flag to toggle whether we should get a new instance of the object.
리턴 FOF30\Form\FieldInterface | boolean FieldInterface object on success, false otherwise.

loadFile() 공개 메소드

The reset option works on a group basis. If the XML file references groups that have already been created they will be replaced with the fields in the new XML file unless the $reset parameter has been set to false.
public loadFile ( string $file, boolean $reset = true, boolean $xpath = false ) : boolean
$file string The filesystem path of an XML file.
$reset boolean Flag to toggle whether form fields should be replaced if a field already exists with the same group/name.
$xpath boolean An optional xpath to search for the fields.
리턴 boolean True on success, false otherwise.

loadHeader() 보호된 메소드

Method to load, setup and return a HeaderInterface object based on field data.
부터: 2.0
protected loadHeader ( string $element, string $group = null ) : FOF30\Form\HeaderInterface | boolean
$element string The XML element object representation of the form field.
$group string The optional dot-separated form group path on which to find the field.
리턴 FOF30\Form\HeaderInterface | boolean The HeaderInterface object for the field or boolean false on error.

loadHeaderType() 보호된 메소드

Proxy for {@link Helper::loadHeaderType()}.
부터: 2.0
protected loadHeaderType ( string $type, boolean $new = true ) : FOF30\Form\HeaderInterface | boolean
$type string The field type.
$new boolean Flag to toggle whether we should get a new instance of the object.
리턴 FOF30\Form\HeaderInterface | boolean HeaderInterface object on success, false otherwise.

loadJSFiles() 공개 메소드

Loads the Javascript files defined in the form, based on its jsfiles attribute
부터: 2.0
public loadJSFiles ( ) : void
리턴 void

loadRuleType() 보호된 메소드

Proxy for {@link Helper::loadRuleType()}.
또한 보기: Helper::loadRuleType()
부터: 2.0
protected loadRuleType ( string $type, boolean $new = true ) : JFormRule | boolean
$type string The rule type.
$new boolean Flag to toggle whether we should get a new instance of the object.
리턴 JFormRule | boolean JFormRule object on success, false otherwise.

loadType() 보호된 메소드

Each type is loaded only once and then used as a prototype for other objects of same type. Please, use this method only with those entities which support types (forms don't support them).
protected loadType ( string $entity, string $type, boolean $new = true ) : mixed
$entity string The entity.
$type string The entity type.
$new boolean Flag to toggle whether we should get a new instance of the object.
리턴 mixed Entity object on success, false otherwise.

modelToBindSource() 보호된 메소드

The $modelsProcessed array which is passed in successive recursions lets us prevent pointless Inception-style recursions, e.g. Model A is related to Model B is related to Model C is related to Model A. You clearly don't care to see a.b.c.a.b in the results. You just want a.b.c. Obviously c is indirectly related to a because that's where you began the recursion anyway.
protected modelToBindSource ( DataModel $model, integer $maxLevel = 1, array $modelsProcessed = [] ) : array
$model FOF30\Model\DataModel The item to dump its contents into an array
$maxLevel integer Maximum nesting level of relations to process. Default: 1.
$modelsProcessed array Array of the fully qualified model class names already processed.
리턴 array

removeHeader() 공개 메소드

Method to remove a header from the form definition.
public removeHeader ( string $name, string $group = null ) : boolean
$name string The name of the form field for which remove.
$group string The optional dot-separated form group path on which to find the field.
리턴 boolean True on success, false otherwise.

setContainer() 공개 메소드

Set the form's Container
public setContainer ( Container $container )
$container FOF30\Container\Container

setModel() 공개 메소드

Attaches a DataModel to this form
public setModel ( DataModel &$model ) : void
$model FOF30\Model\DataModel
리턴 void

setView() 공개 메소드

Attaches a DataViewInterface to this form
public setView ( FOF30\View\DataView\DataViewInterface &$view ) : void
$view FOF30\View\DataView\DataViewInterface
리턴 void

프로퍼티 상세

$container 보호되어 있는 프로퍼티

The Container this form belongs to
protected Container,FOF30\Container $container
리턴 FOF30\Container\Container

$entities 보호되어 있는 프로퍼티

Prototypes for all fields and rules are here. Array's structure: entities: {ENTITY_NAME}: {KEY}: {OBJECT}
protected array $entities
리턴 array

$model 보호되어 있는 프로퍼티

The model attached to this view
protected DataModel,FOF30\Model $model
리턴 FOF30\Model\DataModel

$view 보호되어 있는 프로퍼티

The view used to render this form
protected DataViewInterface,FOF30\View\DataView $view
리턴 FOF30\View\DataView\DataViewInterface