Component
abstract class Component extends Container implements ISignalReceiver, IStatePersistent, ArrayAccess
Component 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.
Properties
callable[] | $onAnchor | ||
protected array | $params | ||
Presenter read-only | $presenter | ||
bool read-only | $linkCurrent |
Methods
Returns the presenter where this component belongs to.
Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
No description
Calls public method if exists.
Checks for requirements such as authorization.
Access to reflection.
Loads state informations.
Saves state informations for next request.
Returns component param.
Returns component parameters.
Returns a fully-qualified name that uniquely identifies the parameter.
Returns array of classes persistent parameters. They have public visibility and are non-static.
Calls signal handler method.
Formats signal handler method name -> case sensitivity doesn't matter.
Generates URL to presenter, action or signal.
Determines whether it links to the current page.
Redirect to another presenter, action or signal.
Permanently redirects to presenter, action or signal.
Throws HTTP error.
Adds the component to the container.
Returns component specified by name. Throws exception if component doesn't exist.
Does component specified by name exists?
Removes component from the container.
Details
at line 37
Presenter|null
getPresenter($throw = true)
Returns the presenter where this component belongs to.
at line 48
string
getUniqueId()
Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
at line 60
protected void
attached($presenter)
This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
at line 72
protected void
validateParent(IContainer $parent)
No description
at line 85
protected bool
tryCall($method, array $params)
Calls public method if exists.
at line 104
void
checkRequirements($element)
Checks for requirements such as authorization.
at line 113
static ComponentReflection
getReflection()
Access to reflection.
at line 127
void
loadState(array $params)
Loads state informations.
at line 155
void
saveState(array $params)
Saves state informations for next request.
at line 167
mixed
getParameter($name, $default = null)
Returns component param.
at line 182
array
getParameters()
Returns component parameters.
at line 193
string
getParameterId($name)
Returns a fully-qualified name that uniquely identifies the parameter.
at line 201
getParam($name = null, $default = null)
deprecated
deprecated
No description
at line 213
static array
getPersistentParams()
Returns array of classes persistent parameters. They have public visibility and are non-static.
This default implementation detects persistent parameters by annotation @persistent.
at line 235
void
signalReceived($signal)
Calls signal handler method.
at line 249
static string
formatSignalMethod($signal)
Formats signal handler method name -> case sensitivity doesn't matter.
at line 265
string
link($destination, $args = [])
Generates URL to presenter, action or signal.
at line 283
Link
lazyLink($destination, $args = [])
Returns destination as Link object.
at line 297
bool
isLinkCurrent($destination = null, $args = [])
Determines whether it links to the current page.
at line 315
void
redirect($code, $destination = null, $args = [])
Redirect to another presenter, action or signal.
at line 338
void
redirectPermanent($destination = null, $args = [])
Permanently redirects to presenter, action or signal.
at line 356
void
error($message = null, $httpCode = Nette\Http\IResponse::S404_NOT_FOUND)
Throws HTTP error.
at line 371
void
offsetSet($name, $component)
Adds the component to the container.
at line 383
IComponent
offsetGet($name)
Returns component specified by name. Throws exception if component doesn't exist.
at line 394
bool
offsetExists($name)
Does component specified by name exists?
at line 405
void
offsetUnset($name)
Removes component from the container.