Component
abstract class Component extends Container implements SignalReceiver, StatePersistent, 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
$onAnchor | |||
protected | $params |
Methods
Returns the presenter where this component belongs to.
Returns the presenter where this component belongs to.
No description
Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
Adds the component to the container.
Is called by a component when it is about to be set new parent. Descendant can override this method to disallow a parent change by throwing an Nette\InvalidStateException
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.
No description
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.
Details
at line 38
Presenter
getPresenter()
Returns the presenter where this component belongs to.
at line 47
Presenter|null
getPresenterIfExists()
Returns the presenter where this component belongs to.
at line 53
bool
hasPresenter()
No description
at line 63
string
getUniqueId()
Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
at line 69
IContainer
addComponent(IComponent $component, string|null $name, string|null $insertBefore = null)
Adds the component to the container.
at line 82
protected void
validateParent(IContainer $parent)
Is called by a component when it is about to be set new parent. Descendant can override this method to disallow a parent change by throwing an Nette\InvalidStateException
at line 95
protected bool
tryCall(string $method, array $params)
Calls public method if exists.
at line 124
void
checkRequirements($element)
Checks for requirements such as authorization.
at line 148
static ComponentReflection
getReflection()
Access to reflection.
at line 160
void
loadState(array $params)
Loads state informations.
at line 188
void
saveState(array $params)
Saves state informations for next request.
at line 197
final mixed
getParameter(string $name, $default = null)
Returns component param.
at line 206
final array
getParameters()
Returns component parameters.
at line 215
final string
getParameterId(string $name)
Returns a fully-qualified name that uniquely identifies the parameter.
at line 229
void
signalReceived(string $signal)
No description
at line 241
static string
formatSignalMethod(string $signal)
Formats signal handler method name -> case sensitivity doesn't matter.
at line 256
string
link(string $destination, mixed ...$args)
Generates URL to presenter, action or signal.
at line 275
Link
lazyLink(string $destination, mixed ...$args)
Returns destination as Link object.
at line 290
bool
isLinkCurrent(string|null $destination = null, mixed ...$args)
Determines whether it links to the current page.
at line 309
void
redirect(string $destination, mixed ...$args)
Redirect to another presenter, action or signal.
at line 325
void
redirectPermanent(string $destination, mixed ...$args)
Permanently redirects to presenter, action or signal.
at line 342
void
error(string $message = '', int $httpCode = Nette\Http\IResponse::S404_NOT_FOUND)
Throws HTTP error.
Traits
Implementation of \ArrayAccess for IContainer.