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
$onAnchor | |||
protected array | $params | ||
Presenter read-only | $presenter | ||
bool read-only | $linkCurrent |
Methods
Returns the presenter where this component belongs to.
Returns the presenter where this component belongs to.
Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
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 40
Presenter|null
getPresenter()
Returns the presenter where this component belongs to.
at line 53
Presenter|null
getPresenterIfExists()
Returns the presenter where this component belongs to.
at line 60
bool
hasPresenter()
deprecated
deprecated
No description
at line 70
string
getUniqueId()
Returns a fully-qualified name that uniquely identifies the component within the presenter hierarchy.
at line 76
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 90
protected bool
tryCall(string $method, array $params)
Calls public method if exists.
at line 113
void
checkRequirements($element)
Checks for requirements such as authorization.
at line 130
static ComponentReflection
getReflection()
Access to reflection.
at line 142
void
loadState(array $params)
Loads state informations.
at line 168
void
saveState(array $params)
Saves state informations for next request.
at line 178
final mixed
getParameter(string $name, $default = null)
Returns component param.
at line 187
final array
getParameters()
Returns component parameters.
at line 196
final string
getParameterId(string $name)
Returns a fully-qualified name that uniquely identifies the parameter.
at line 204
final
getParam($name = null, $default = null)
deprecated
deprecated
No description
at line 220
void
signalReceived(string $signal)
No description
at line 232
static string
formatSignalMethod(string $signal)
Formats signal handler method name -> case sensitivity doesn't matter.
at line 247
string
link(string $destination, array|mixed $args = [])
Generates URL to presenter, action or signal.
at line 266
Link
lazyLink(string $destination, array|mixed $args = [])
Returns destination as Link object.
at line 281
bool
isLinkCurrent(string $destination = null, array|mixed $args = [])
Determines whether it links to the current page.
at line 299
void
redirect(string $destination, array|mixed $args = [])
Redirect to another presenter, action or signal.
at line 325
void
redirectPermanent(string $destination, array|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.