Class PresenterComponent
PresenterComponent is the base class for all Presenter components.
Components are persistent objects located on a presenter. They have ability to own other child components, and interact with user. Components have properties for storing their status, and responds to user command.
- Object
-
Component implements IComponent
-
ComponentContainer implements IComponentContainer
-
PresenterComponent implements ISignalReceiver, IStatePersistent, ArrayAccess
Direct Known Subclasses
Control
public
|
#
__construct(
IComponentContainer
$parent = NULL,
$name = NULL
)
|
public
Presenter|NULL
|
#
getPresenter(
bool
$need = true
)
Returns the presenter where this component belongs to. Returns the presenter where this component belongs to. Parameters$need bool throw exception if presenter doesn't exist? |
public
string
|
#
getUniqueId(
)
Returns a fully-qualified name that uniquely identifies the component Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy. |
protected
void
|
#
attached(
IComponent
$presenter
)
This method will be called when the component (or component's parent) This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself. Parameters$presenter IComponent |
protected
bool
|
#
tryCall(
string
$method,
array
$params
)
Calls public method if exists. Calls public method if exists. Parameters$method string$params arrayReturnsbool does method exist?
|
public
PresenterComponentReflection
|
#
getReflection(
)
Access to reflection. Access to reflection. |
public
void
|
#
loadState(
array
$params
)
Loads state informations. |
public
void
|
#
saveState(
array
& $params,
PresenterComponentReflection
$reflection = NULL
)
Saves state informations for next request. Saves state informations for next request. Parameters$params array$reflection PresenterComponentReflection (internal, used by Presenter)Implementation of |
final public
mixed
|
#
getParam(
string
$name = NULL,
mixed
$default = NULL
)
Returns component param. Returns component param. If no key is passed, returns the entire array. Parameters$name string key$default mixed default value |
final public
string
|
#
getParamId(
$name
)
Returns a fully-qualified name that uniquely identifies the parameter. Returns a fully-qualified name that uniquely identifies the parameter. |
public static
array
|
#
getPersistentParams(
)
Returns array of classes persistent parameters. They have public visibility and are non-static. Returns array of classes persistent parameters. They have public visibility and are non-static. This default implementation detects persistent parameters by annotation @persistent. |
public
void
|
#
signalReceived(
string
$signal
)
Calls signal handler method. Calls signal handler method. Parameters$signal stringThrows
BadSignalException if there is not handler method
Implementation of |
public
string
|
#
formatSignalMethod(
string
$signal
)
Formats signal handler method name → case sensitivity doesn't matter. Formats signal handler method name → case sensitivity doesn't matter. Parameters$signal string |
public
string
|
#
link(
string
$destination,
array|mixed
$args = array (
)
)
Generates URL to presenter, action or signal. Generates URL to presenter, action or signal. Parameters$destination string destination in format "[[module:]presenter:]action" or "signal!" or "this"$args array|mixedThrows |
public
Link
|
#
lazyLink(
string
$destination,
array|mixed
$args = array (
)
)
Returns destination as Link object. Returns destination as Link object. Parameters$destination string destination in format "[[module:]presenter:]view" or "signal!"$args array|mixed |
public
bool
|
#
isLinkCurrent(
string
$destination = NULL,
array|mixed
$args = array (
)
)
Determines whether it links to the current page. Determines whether it links to the current page. Parameters$destination string destination in format "[[module:]presenter:]action" or "signal!" or "this"$args array|mixedThrows |
public
void
|
#
redirect(
int
$code,
string
$destination = NULL,
array|mixed
$args = array (
)
)
Redirect to another presenter, action or signal. Redirect to another presenter, action or signal. Parameters$code int [optional] HTTP error code$destination string destination in format "[[module:]presenter:]view" or "signal!"$args array|mixedThrows |
final public
void
|
#
offsetSet(
string
$name,
IComponent
$component
)
Adds the component to the container. Adds the component to the container. Parameters$name string component name$component IComponentImplementation of |
final public
IComponent
|
#
offsetGet(
string
$name
)
Returns component specified by name. Throws exception if component doesn't exist. Returns component specified by name. Throws exception if component doesn't exist. Parameters$name string component nameThrowsImplementation of |
final public
bool
|
#
offsetExists(
string
$name
)
Does component specified by name exists? Does component specified by name exists? Parameters$name string component nameImplementation of |
final public
void
|
#
offsetUnset(
string
$name
)
Removes component from the container. Removes component from the container. Parameters$name string component nameImplementation of |
Methods Inherited From ComponentContainer
addComponent(), removeComponent(), getComponent(), createComponent(), getComponents(), validateChildComponent(), __clone()
Methods Inherited From Component
__construct(), lookup(), lookupPath(), monitor(), unmonitor(), attached(), detached(), getName(), getParent(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
getReflection(), __call(), __callStatic(), extensionMethod(), __get(), __set(), __isset(), __unset()
Constants Inherited From Component
NAME_SEPARATOR
protected
array
|
$params | array (
) |
# |