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:
| Constructor Summary | |
|---|---|
| public |
__construct
(PresenterRequest $request)
|
| Method Summary | |
|---|---|
| protected void |
afterRender
()
Common render method.
|
| string |
backlink
()
Link to myself.
|
| protected void |
Common prepare method.
|
| protected void |
beforeRender
()
Common render method.
|
| void |
canonicalize
()
Conditional redirect to canonicalized URI.
|
| void |
changeLayout
(string|FALSE $layout)
Changes or disables layout.
|
| void |
changeScene
(string $scene)
Changes current view scene. Any name is allowed.
|
| void |
changeView
(string $view)
Changes current view. Only alphanumeric characters are allowed.
|
| protected IAjaxDriver |
|
| protected string |
createRequest
(PresenterComponent $component, string $destination, $args, string $mode)
PresenterRequest/URL factory.
|
| protected array |
formatLayoutTemplateFiles
(string $presenter, string $layout)
Formats layout template file names.
|
| protected static string |
formatPrepareMethod
(string $scene)
Formats prepare scene method name.
|
| protected static string |
formatPresentMethod
(string $view)
Formats execute method name.
|
| protected static string |
formatRenderMethod
(string $scene)
Formats render scene method name.
|
| protected array |
formatTemplateFiles
(string $presenter, string $scene)
Formats scene template file names.
|
| void |
Forward to another presenter or view.
|
| IAjaxDriver|NULL |
|
| Application |
|
| SesssionNamespace |
Returns session namespace provided to pass temporary data between redirects.
|
| protected IHttpRequest |
|
| protected IHttpResponse |
|
| PresenterRequest |
Returns the last created PresenterRequest.
|
| bool |
getLastCreatedRequestFlag
(string $flag)
Returns the last created PresenterRequest flag.
|
| string|FALSE |
getLayout
()
Returns current layout name.
|
| int |
getPhase
()
Returns current presenter life cycle phase.
|
| Presenter |
getPresenter
([$need =
TRUE])
Returns self.
|
| PresenterRequest |
getRequest
([bool $clone =
TRUE])
|
| string |
getScene
()
Returns current scene name.
|
| array|NULL |
getSignal
()
Returns pair signal receiver and name.
|
| string |
getUniqueId
()
Returns a name that uniquely identifies component.
|
| string |
getView
([$fullyQualified =
FALSE])
Returns current view name.
|
| protected string |
Invalid link handler.
|
| 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.
|
| int |
Attempts to cache the sent entity by its last modification date
|
| array |
popGlobalParams
(string $id)
Pops parameters for specified component.
|
| protected void |
|
| void |
redirectUri
(string $uri, [int $code =
IHttpResponse::S303_POST_GET])
Redirect to another URL and ends presenter execution.
|
| protected void |
|
| void |
run
()
|
| protected void |
Permanently saves state information for all subcomponents to $this->globalState.
|
| protected void |
shutdown
()
|
| protected void |
startup
()
|
| void |
terminate
()
Correctly terminates presenter.
|
| Constant Summary | |||
|---|---|---|---|
| string | FLASH_KEY |
'_fid' |
line 59 special parameter key |
| int | INVALID_LINK_EXCEPTION |
3 |
line 53 bad link handling Presenter::$invalidLinkMode |
| int | INVALID_LINK_SILENT |
1 |
line 51 bad link handling Presenter::$invalidLinkMode |
| int | INVALID_LINK_WARNING |
2 |
line 52 bad link handling Presenter::$invalidLinkMode |
| int | PHASE_PREPARE |
2 |
line 44 life cycle phases Presenter::getPhase() |
| int | PHASE_RENDER |
4 |
line 46 life cycle phases Presenter::getPhase() |
| int | PHASE_SHUTDOWN |
5 |
line 47 life cycle phases Presenter::getPhase() |
| int | PHASE_SIGNAL |
3 |
line 45 life cycle phases Presenter::getPhase() |
| int | PHASE_STARTUP |
1 |
line 43 life cycle phases Presenter::getPhase() |
| string | SIGNAL_KEY |
'do' |
line 57 special parameter key |
| string | VIEW_KEY |
'view' |
line 58 special parameter key |
| Variable Summary | ||||
|---|---|---|---|---|
| bool | $autoCanonicalize | TRUE |
line 78 automatically call canonicalize() |
|
| static string | $defaultView | 'default' |
line 63 |
|
| static int | $invalidLinkMode | |
line 66 |
|
| array | $onShutdown | |
line 69 of event handlers; Occurs when the presenter is shutting down; function(Presenter $sender, Exception $exception = NULL) |
|
| Constructor Details | ||||||
|---|---|---|---|---|---|---|
|
line 121 __constructpublic __construct (PresenterRequest $request)
|
||||||
| Method Details | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 287 afterRenderprotected void afterRender () Common render method.
|
|||||||||||||||||||||||||||
|
line 690 backlinkpublic string backlink () Link to myself.
|
|||||||||||||||||||||||||||
|
line 267 beforePrepareprotected void beforePrepare () Common prepare method.
|
|||||||||||||||||||||||||||
|
line 277 beforeRenderprotected void beforeRender () Common render method.
|
|||||||||||||||||||||||||||
|
line 737 canonicalizepublic void canonicalize () Conditional redirect to canonicalized URI.
|
|||||||||||||||||||||||||||
|
line 445 changeLayoutpublic void changeLayout (string|FALSE $layout) Changes or disables layout.
|
|||||||||||||||||||||||||||
|
line 422 changeScenepublic void changeScene (string $scene) Changes current view scene. Any name is allowed.
|
|||||||||||||||||||||||||||
|
line 393 changeViewpublic void changeView (string $view) Changes current view. Only alphanumeric characters are allowed.
|
|||||||||||||||||||||||||||
|
line 632 createAjaxDriverprotected IAjaxDriver createAjaxDriver ()
|
|||||||||||||||||||||||||||
|
line 830 createRequestprotected string createRequest (PresenterComponent $component, string $destination, $args, string $mode) PresenterRequest/URL factory.
|
|||||||||||||||||||||||||||
|
line 509 formatLayoutTemplateFilesprotected array formatLayoutTemplateFiles (string $presenter, string $layout) Formats layout template file names.
|
|||||||||||||||||||||||||||
|
line 574 formatPrepareMethodprotected static string formatPrepareMethod (string $scene) Formats prepare scene method name.
|
|||||||||||||||||||||||||||
|
line 562 formatPresentMethodprotected static string formatPresentMethod (string $view) Formats execute method name.
|
|||||||||||||||||||||||||||
|
line 586 formatRenderMethodprotected static string formatRenderMethod (string $scene) Formats render scene method name.
|
|||||||||||||||||||||||||||
|
line 540 formatTemplateFilesprotected array formatTemplateFiles (string $presenter, string $scene) Formats scene template file names.
|
|||||||||||||||||||||||||||
|
line 650 forwardpublic void forward (string|PresenterRequest $destination, [array|mixed $args = Forward to another presenter or view.
|
|||||||||||||||||||||||||||
|
line 614 getAjaxDriverpublic IAjaxDriver|NULL getAjaxDriver ()
|
|||||||||||||||||||||||||||
|
line 1263 getApplicationpublic Application getApplication ()
|
|||||||||||||||||||||||||||
|
line 1226 getFlashSessionpublic SesssionNamespace getFlashSession () Returns session namespace provided to pass temporary data between redirects.
|
|||||||||||||||||||||||||||
|
line 1243 getHttpRequestprotected IHttpRequest getHttpRequest ()
|
|||||||||||||||||||||||||||
|
line 1253 getHttpResponseprotected IHttpResponse getHttpResponse ()
|
|||||||||||||||||||||||||||
|
line 701 getLastCreatedRequestpublic PresenterRequest getLastCreatedRequest () Returns the last created PresenterRequest.
|
|||||||||||||||||||||||||||
|
line 713 getLastCreatedRequestFlagpublic bool getLastCreatedRequestFlag (string $flag) Returns the last created PresenterRequest flag.
|
|||||||||||||||||||||||||||
|
line 433 getLayoutpublic string|FALSE getLayout () Returns current layout name.
|
|||||||||||||||||||||||||||
|
line 247 getPhasepublic int getPhase () Returns current presenter life cycle phase.
|
|||||||||||||||||||||||||||
|
line 144 getPresenterpublic Presenter getPresenter ([$need = Returns self.
|
|||||||||||||||||||||||||||
|
line 133 getRequestpublic PresenterRequest getRequest ([bool $clone =
|
|||||||||||||||||||||||||||
|
line 410 getScenepublic string getScene () Returns current scene name.
|
|||||||||||||||||||||||||||
|
line 337 getSignalpublic array|NULL getSignal () Returns pair signal receiver and name.
|
|||||||||||||||||||||||||||
|
line 155 getUniqueIdpublic string getUniqueId () Returns a name that uniquely identifies component.
|
|||||||||||||||||||||||||||
|
line 381 getViewpublic string getView ([$fullyQualified = Returns current view name.
|
|||||||||||||||||||||||||||
|
line 1028 handleInvalidLinkprotected string handleInvalidLink (InvalidLinkException $e) Invalid link handler.
|
|||||||||||||||||||||||||||
|
line 1214 hasFlashSessionpublic bool hasFlashSession () Checks if a flash session namespace exists.
|
|||||||||||||||||||||||||||
|
line 601 isAjaxpublic bool isAjax () Is AJAX request?
|
|||||||||||||||||||||||||||
|
line 350 isSignalReceiverpublic bool isSignalReceiver (mixed $component, [string $signal = Checks if the signal receiver is the given one.
|
|||||||||||||||||||||||||||
|
line 757 lastModifiedpublic int lastModified (int $lastModified, [string $etag = Attempts to cache the sent entity by its last modification date
|
|||||||||||||||||||||||||||
|
line 1192 popGlobalParamspublic array popGlobalParams (string $id) Pops parameters for specified component.
|
|||||||||||||||||||||||||||
|
line 310 processSignalprotected void processSignal ()
|
|||||||||||||||||||||||||||
|
line 673 redirectUripublic void redirectUri (string $uri, [int $code = Redirect to another URL and ends presenter execution.
|
|||||||||||||||||||||||||||
|
line 456 renderTemplateprotected void renderTemplate ()
|
|||||||||||||||||||||||||||
|
line 170 runpublic void run () Implementation of:
|
|||||||||||||||||||||||||||
|
line 1129 saveGlobalStateprotected void saveGlobalState () Permanently saves state information for all subcomponents to $this->globalState.
|
|||||||||||||||||||||||||||
|
line 296 shutdownprotected void shutdown ()
|
|||||||||||||||||||||||||||
|
line 257 startupprotected void startup ()
|
|||||||||||||||||||||||||||
|
line 725 terminatepublic void terminate () Correctly terminates presenter.
|
|||||||||||||||||||||||||||