PHP Trait Nextras\Forms\Controls\Fragments\ComponentControlTrait

Author: Jan Skrasek
Exibir arquivo Open project: nextras/forms

Public Properties

Property Type Description
$onAnchor function (self $sender); Occurs when component is attached to presenter

Protected Properties

Property Type Description
$params array

Public Methods

Method Description
__clone ( ) Object cloning.
_isCloning ( ) : null | Nette\ComponentModel\IComponent Is container cloning now?
addComponent ( Nette\ComponentModel\IComponent $component, $name, $insertBefore = NULL ) : self Adds the specified component to the IContainer.
checkRequirements ( $element ) : void Checks for requirements such as authorization.
formatSignalMethod ( $signal ) : string Formats signal handler method name -> case sensitivity doesn't matter.
getComponent ( $name, $need = TRUE ) : Nette\ComponentModel\IComponent | null Returns component specified by name or path.
getComponents ( $deep = FALSE, $filterType = NULL ) : ArrayIterator Iterates over components.
getParam ( $name = NULL, $default = NULL )
getParameter ( $name, $default = NULL ) : mixed Returns component param.
getParameterId ( $name ) : string Returns a fully-qualified name that uniquely identifies the parameter.
getParameters ( ) : array Returns component parameters.
getPersistentParams ( ) : array Returns array of classes persistent parameters. They have public visibility and are non-static.
getPresenter ( $need = TRUE ) : Nette\Application\UI\Presenter | null Returns the presenter where this component belongs to.
getReflection ( ) : Nette\Application\UI\ComponentReflection Access to reflection.
getUniqueId ( ) : string Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
link ( $destination, $args = [] ) : string Generates URL to presenter, action or signal.
loadState ( array $params ) : void Loads state informations.
offsetExists ( $name ) : boolean Does component specified by name exists?
offsetGet ( $name ) : Nette\ComponentModel\IComponent Returns component specified by name. Throws exception if component doesn't exist.
offsetSet ( $name, $component ) : void Adds the component to the container.
offsetUnset ( $name ) : void Removes component from the container.
removeComponent ( Nette\ComponentModel\IComponent $component ) : void Removes a component from the IContainer.
saveState ( array &$params, $reflection = NULL ) : void Saves state informations for next request.
signalReceived ( $signal ) : void Calls signal handler method.

Protected Methods

Method Description
attached ( $presenter ) : void This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
createComponent ( $name ) : Nette\ComponentModel\IComponent Component factory. Delegates the creation of components to a createComponent method.
tryCall ( $method, array $params ) : boolean Calls public method if exists.
validateChildComponent ( Nette\ComponentModel\IComponent $child ) : void Descendant can override this method to disallow insert a child by throwing an Nette\InvalidStateException.
validateParent ( Nette\ComponentModel\IContainer $parent ) : void

Method Details

__clone() public method

Object cloning.
public __clone ( )

_isCloning() public method

Is container cloning now?
public _isCloning ( ) : null | Nette\ComponentModel\IComponent
return null | Nette\ComponentModel\IComponent

addComponent() public method

Adds the specified component to the IContainer.
public addComponent ( Nette\ComponentModel\IComponent $component, $name, $insertBefore = NULL ) : self
$component Nette\ComponentModel\IComponent
return self

attached() protected method

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
protected attached ( $presenter ) : void
return void

checkRequirements() public method

Checks for requirements such as authorization.
public checkRequirements ( $element ) : void
return void

createComponent() protected method

Component factory. Delegates the creation of components to a createComponent method.
protected createComponent ( $name ) : Nette\ComponentModel\IComponent
return Nette\ComponentModel\IComponent the created component (optionally)

formatSignalMethod() public static method

Formats signal handler method name -> case sensitivity doesn't matter.
public static formatSignalMethod ( $signal ) : string
return string

getComponent() public method

Returns component specified by name or path.
public getComponent ( $name, $need = TRUE ) : Nette\ComponentModel\IComponent | null
return Nette\ComponentModel\IComponent | null

getComponents() public method

Iterates over components.
public getComponents ( $deep = FALSE, $filterType = NULL ) : ArrayIterator
return ArrayIterator

getParam() public method

Deprecation:
public getParam ( $name = NULL, $default = NULL )

getParameter() public method

Returns component param.
public getParameter ( $name, $default = NULL ) : mixed
return mixed

getParameterId() public method

Returns a fully-qualified name that uniquely identifies the parameter.
public getParameterId ( $name ) : string
return string

getParameters() public method

Returns component parameters.
public getParameters ( ) : array
return array

getPersistentParams() public static method

This default implementation detects persistent parameters by annotation @persistent.
public static getPersistentParams ( ) : array
return array

getPresenter() public method

Returns the presenter where this component belongs to.
public getPresenter ( $need = TRUE ) : Nette\Application\UI\Presenter | null
return Nette\Application\UI\Presenter | null

getReflection() public static method

Access to reflection.
public static getReflection ( ) : Nette\Application\UI\ComponentReflection
return Nette\Application\UI\ComponentReflection

getUniqueId() public method

Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
public getUniqueId ( ) : string
return string

loadState() public method

Loads state informations.
public loadState ( array $params ) : void
$params array
return void

offsetExists() public method

Does component specified by name exists?
public offsetExists ( $name ) : boolean
return boolean

offsetGet() public method

Returns component specified by name. Throws exception if component doesn't exist.
public offsetGet ( $name ) : Nette\ComponentModel\IComponent
return Nette\ComponentModel\IComponent

offsetSet() public method

Adds the component to the container.
public offsetSet ( $name, $component ) : void
return void

offsetUnset() public method

Removes component from the container.
public offsetUnset ( $name ) : void
return void

removeComponent() public method

Removes a component from the IContainer.
public removeComponent ( Nette\ComponentModel\IComponent $component ) : void
$component Nette\ComponentModel\IComponent
return void

saveState() public method

Saves state informations for next request.
public saveState ( array &$params, $reflection = NULL ) : void
$params array
return void

signalReceived() public method

Calls signal handler method.
public signalReceived ( $signal ) : void
return void

tryCall() protected method

Calls public method if exists.
protected tryCall ( $method, array $params ) : boolean
$params array
return boolean does method exist?

validateChildComponent() protected method

Descendant can override this method to disallow insert a child by throwing an Nette\InvalidStateException.
protected validateChildComponent ( Nette\ComponentModel\IComponent $child ) : void
$child Nette\ComponentModel\IComponent
return void

validateParent() protected method

protected validateParent ( Nette\ComponentModel\IContainer $parent ) : void
$parent Nette\ComponentModel\IContainer
return void

Property Details

$onAnchor public_oe property

function (self $sender); Occurs when component is attached to presenter
public $onAnchor

$params protected_oe property

protected array $params
return array