Class Presenter (namespace Nette\Application)
Presenter object represents a webpage instance. It executes all the logic for the request.
Object | --Component | --ComponentContainer | --PresenterComponent | --Control | --Presenter
Implements interfaces:
Public Method Summary | |
---|---|
string |
backlink
()
Link to myself.
|
void |
canonicalize
()
Conditional redirect to canonicalized URI.
|
void |
changeAction
(string $action)
Changes current action. Only alphanumeric characters are allowed.
|
array |
formatLayoutTemplateFiles
(string $presenter, string $layout)
Formats layout template file names.
|
array |
formatTemplateFiles
(string $presenter, string $view)
Formats view template file names.
|
void |
Forward to another presenter or action.
|
string |
getAction
([$fullyQualified =
FALSE ])
Returns current action name.
|
void |
|
Application |
|
SessionNamespace |
Returns session namespace provided to pass temporary data between redirects.
|
PresenterRequest |
Returns the last created PresenterRequest.
|
bool |
getLastCreatedRequestFlag
(string $flag)
Returns the last created PresenterRequest flag.
|
string|FALSE |
getLayout
()
Returns current layout name.
|
stdClass |
getPayload
()
|
static array |
Returns array of persistent components.
|
void |
getPhase
()
|
Presenter |
getPresenter
([$need =
TRUE ])
Returns self.
|
PresenterRequest |
getRequest
()
|
array|NULL |
getSignal
()
Returns pair signal receiver and name.
|
string |
getUniqueId
()
Returns a name that uniquely identifies component.
|
string |
getView
()
Returns current view.
|
bool |
Checks if a flash session namespace exists.
|
bool |
isAjax
()
Is AJAX request?
|
bool |
isSignalReceiver
(mixed $component, [string $signal =
NULL ])
Checks if the signal receiver is the given one.
|
void |
Attempts to cache the sent entity by its last modification date
|
array |
popGlobalParams
(string $id)
Pops parameters for specified component.
|
void |
|
void |
redirectUri
(string $uri, [int $code =
NULL ])
Redirect to another URL and ends presenter execution.
|
IPresenterResponse |
run
(PresenterRequest $request)
|
void |
sendTemplate
()
|
Presenter |
setLayout
(string|FALSE $layout)
Changes or disables layout.
|
Presenter |
setView
(string $view)
Changes current view. Any name is allowed.
|
void |
Correctly terminates presenter.
|
Protected Method Summary | |
---|---|
protected void |
afterRender
()
Common render method.
|
protected void |
beforeRender
()
Common render method.
|
protected static string |
formatActionMethod
(string $action)
Formats action method name.
|
protected static string |
formatRenderMethod
(string $view)
Formats render view method name.
|
protected HttpContext |
|
protected HttpRequest |
|
protected HttpResponse |
|
protected Session |
getSession
([$namespace =
NULL ])
|
protected User |
getUser
()
|
protected string |
Invalid link handler. Descendant can override this method to change default behaviour.
|
protected void |
|
protected void |
Permanently saves state information for all subcomponents to $this->globalState.
|
protected void |
sendPayload
()
Sends AJAX payload to the output.
|
protected void |
shutdown
(IPresenterResponse $response)
|
protected void |
startup
()
|
Methods Inherited From Control |
---|
createTemplate(), flashMessage(), getSnippetId(), getTemplate(), getWidget(), invalidateControl(), isControlInvalid(), templatePrepareFilters(), validateControl() |
Methods Inherited From ComponentContainer |
---|
addComponent(), createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent(), __clone() |
Methods Inherited From Component |
---|
__construct(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent(), __clone(), __wakeup() |
Methods Inherited From Object |
---|
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset() |
Constant Summary | |||
---|---|---|---|
int | INVALID_LINK_EXCEPTION |
3 |
line 42 bad link handling Presenter::$invalidLinkMode |
int | INVALID_LINK_SILENT |
1 |
line 40 bad link handling Presenter::$invalidLinkMode |
int | INVALID_LINK_WARNING |
2 |
line 41 bad link handling Presenter::$invalidLinkMode |
int | PHASE_RENDER |
4 |
line 35 |
int | PHASE_SHUTDOWN |
5 |
line 36 |
int | PHASE_SIGNAL |
3 |
line 34 |
int | PHASE_STARTUP |
1 |
line 33 |
Variable Summary | ||||
---|---|---|---|---|
bool | $absoluteUrls | FALSE |
line 79 use absolute Urls or paths? |
|
bool | $autoCanonicalize | TRUE |
line 76 automatically call canonicalize() |
|
static string | $defaultAction | 'default' |
line 52 |
|
static int | $invalidLinkMode |
|
line 55 |
|
bool | $oldLayoutMode | TRUE |
line 61 (experimental) |
|
bool | $oldModuleMode | TRUE |
line 64 (experimental) |
|
array | $onShutdown |
|
line 58 of function(Presenter $sender, IPresenterResponse $response = NULL); Occurs when the presenter is shutting down |
Method Details | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 285 afterRenderprotected void afterRender () Common render method.
|
||||||||||||||||||||||||||||||
line 724 backlinkpublic string backlink () Link to myself.
|
||||||||||||||||||||||||||||||
line 275 beforeRenderprotected void beforeRender () Common render method.
|
||||||||||||||||||||||||||||||
line 773 canonicalizepublic void canonicalize () Conditional redirect to canonicalized URI.
|
||||||||||||||||||||||||||||||
line 392 changeActionpublic void changeAction (string $action) Changes current action. Only alphanumeric characters are allowed.
|
||||||||||||||||||||||||||||||
line 593 formatActionMethodprotected static string formatActionMethod (string $action) Formats action method name.
|
||||||||||||||||||||||||||||||
line 513 formatLayoutTemplateFilespublic array formatLayoutTemplateFiles (string $presenter, string $layout) Formats layout template file names.
|
||||||||||||||||||||||||||||||
line 605 formatRenderMethodprotected static string formatRenderMethod (string $view) Formats render view method name.
|
||||||||||||||||||||||||||||||
line 557 formatTemplateFilespublic array formatTemplateFiles (string $presenter, string $view) Formats view template file names.
|
||||||||||||||||||||||||||||||
line 683 forwardpublic void forward (string|PresenterRequest $destination, [array|mixed $args = Forward to another presenter or action.
|
||||||||||||||||||||||||||||||
line 380 getActionpublic string getAction ([$fullyQualified = Returns current action name.
|
||||||||||||||||||||||||||||||
line 665 getAjaxDriverpublic void getAjaxDriver ()
|
||||||||||||||||||||||||||||||
line 1349 getApplicationpublic Application getApplication ()
|
||||||||||||||||||||||||||||||
line 1302 getFlashSessionpublic SessionNamespace getFlashSession () Returns session namespace provided to pass temporary data between redirects.
|
||||||||||||||||||||||||||||||
line 1339 getHttpContextprotected HttpContext getHttpContext ()
|
||||||||||||||||||||||||||||||
line 1319 getHttpRequestprotected HttpRequest getHttpRequest ()
|
||||||||||||||||||||||||||||||
line 1329 getHttpResponseprotected HttpResponse getHttpResponse ()
|
||||||||||||||||||||||||||||||
line 735 getLastCreatedRequestpublic PresenterRequest getLastCreatedRequest () Returns the last created PresenterRequest.
|
||||||||||||||||||||||||||||||
line 747 getLastCreatedRequestFlagpublic bool getLastCreatedRequestFlag (string $flag) Returns the last created PresenterRequest flag.
|
||||||||||||||||||||||||||||||
line 433 getLayoutpublic string|FALSE getLayout () Returns current layout name.
|
||||||||||||||||||||||||||||||
line 629 getPayloadpublic stdClass getPayload ()
|
||||||||||||||||||||||||||||||
line 1120 getPersistentComponentspublic static array getPersistentComponents () Returns array of persistent components. This default implementation detects components by class-level annotation @persistent(cmp1, cmp2).
|
||||||||||||||||||||||||||||||
line 253 getPhasepublic void getPhase ()
|
||||||||||||||||||||||||||||||
line 136 getPresenterpublic Presenter getPresenter ([$need = Returns self.
|
||||||||||||||||||||||||||||||
line 125 getRequestpublic PresenterRequest getRequest ()
|
||||||||||||||||||||||||||||||
line 1359 getSessionprotected Session getSession ([$namespace =
|
||||||||||||||||||||||||||||||
line 336 getSignalpublic array|NULL getSignal () Returns pair signal receiver and name.
|
||||||||||||||||||||||||||||||
line 147 getUniqueIdpublic string getUniqueId () Returns a name that uniquely identifies component.
|
||||||||||||||||||||||||||||||
line 1369 getUserprotected User getUser ()
|
||||||||||||||||||||||||||||||
line 409 getViewpublic string getView () Returns current view.
|
||||||||||||||||||||||||||||||
line 1091 handleInvalidLinkprotected string handleInvalidLink (InvalidLinkException $e) Invalid link handler. Descendant can override this method to change default behaviour.
|
||||||||||||||||||||||||||||||
line 1290 hasFlashSessionpublic bool hasFlashSession () Checks if a flash session namespace exists.
|
||||||||||||||||||||||||||||||
line 640 isAjaxpublic bool isAjax () Is AJAX request?
|
||||||||||||||||||||||||||||||
line 349 isSignalReceiverpublic bool isSignalReceiver (mixed $component, [string $signal = Checks if the signal receiver is the given one.
|
||||||||||||||||||||||||||||||
line 794 lastModifiedpublic void lastModified (string|int|DateTime $lastModified, [string $etag = Attempts to cache the sent entity by its last modification date
|
||||||||||||||||||||||||||||||
line 1268 popGlobalParamspublic array popGlobalParams (string $id) Pops parameters for specified component.
|
||||||||||||||||||||||||||||||
line 309 processSignalpublic void processSignal ()
|
||||||||||||||||||||||||||||||
line 706 redirectUripublic void redirectUri (string $uri, [int $code = Redirect to another URL and ends presenter execution.
|
||||||||||||||||||||||||||||||
line 615 renderTemplateprotected void renderTemplate ()
|
||||||||||||||||||||||||||||||
line 162 runpublic IPresenterResponse run (PresenterRequest $request) Implementation of:
|
||||||||||||||||||||||||||||||
line 1200 saveGlobalStateprotected void saveGlobalState () Permanently saves state information for all subcomponents to $this->globalState.
|
||||||||||||||||||||||||||||||
line 655 sendPayloadprotected void sendPayload () Sends AJAX payload to the output.
|
||||||||||||||||||||||||||||||
line 458 sendTemplatepublic void sendTemplate ()
|
||||||||||||||||||||||||||||||
line 445 setLayoutpublic Presenter setLayout (string|FALSE $layout) Changes or disables layout.
|
||||||||||||||||||||||||||||||
line 421 setViewpublic Presenter setView (string $view) Changes current view. Any name is allowed.
|
||||||||||||||||||||||||||||||
line 295 shutdownprotected void shutdown (IPresenterResponse $response)
|
||||||||||||||||||||||||||||||
line 264 startupprotected void startup ()
|
||||||||||||||||||||||||||||||
line 760 terminatepublic void terminate ([IPresenterResponse $response = Correctly terminates presenter.
|