Presenter
abstract class Presenter extends Control implements IPresenter
Presenter component represents a webpage instance. It converts Request to IResponse.
Constants
INVALID_LINK_SILENT |
bad link handling Presenter::$invalidLinkMode |
INVALID_LINK_WARNING |
bad link handling Presenter::$invalidLinkMode |
INVALID_LINK_EXCEPTION |
bad link handling Presenter::$invalidLinkMode |
internal SIGNAL_KEY |
|
internal ACTION_KEY |
|
internal FLASH_KEY |
|
internal DEFAULT_ACTION |
|
Properties
int | $invalidLinkMode | ||
array | $onShutdown | ||
bool | $autoCanonicalize | ||
bool | $absoluteUrls | ||
string | $view | ||
string | $layout | ||
Request read-only | $request | ||
array|null read-only | $signal | ||
string read-only | $action | ||
stdClass read-only | $payload | ||
bool read-only | $ajax | ||
Request read-only | $lastCreatedRequest | ||
SessionSection read-only | $flashSession | ||
SystemContainer|Container read-only | $context | ||
Session read-only | $session | ||
User read-only | $user |
Methods
No description
No description
Returns self.
Returns a name that uniquely identifies component.
No description
Common render method.
Common render method.
No description
Checks authorization.
No description
Returns pair signal receiver and name.
Checks if the signal receiver is the given one.
Returns current action name.
Changes current action. Only alphanumeric characters are allowed.
Returns current view.
Returns current layout name.
No description
Finds layout template file name.
Formats layout template file names.
Formats view template file names.
Formats action method name.
Formats render view method name.
No description
Is AJAX request?
Sends AJAX payload to the output.
Sends JSON data to the output.
Correctly terminates presenter.
Forward to another presenter or action.
Redirect to another URL and ends presenter execution.
Throws HTTP error.
Link to myself.
Returns the last created Request.
Returns the last created Request flag.
Conditional redirect to canonicalized URI.
Attempts to cache the sent entity by its last modification date.
Request/URL factory.
Invalid link handler. Descendant can override this method to change default behaviour.
Stores current request to session.
Restores request from session.
Returns array of persistent components.
Permanently saves state information for all subcomponents to $this->globalState.
Pops parameters for specified component.
Checks if a flash session namespace exists.
Returns session namespace provided to pass temporary data between redirects.
No description
No description
No description
No description
No description
Details
at line 127
__construct()
No description
at line 135
Request
getRequest()
No description
at line 145
Presenter|null
getPresenter($need = TRUE)
Returns self.
at line 155
string
getUniqueId()
Returns a name that uniquely identifies component.
at line 250
protected void
startup()
No description
at line 260
protected void
beforeRender()
Common render method.
at line 269
protected void
afterRender()
Common render method.
at line 278
protected void
shutdown($response)
No description
at line 287
void
checkRequirements($element)
Checks authorization.
at line 303
void
processSignal()
No description
at line 329
array|null
getSignal()
Returns pair signal receiver and name.
at line 341
bool
isSignalReceiver($component, $signal = NULL)
Checks if the signal receiver is the given one.
at line 370
string
getAction($fullyQualified = FALSE)
Returns current action name.
at line 381
void
changeAction($action)
Changes current action. Only alphanumeric characters are allowed.
at line 397
string
getView()
Returns current view.
at line 408
Presenter
setView($view)
Changes current view. Any name is allowed.
at line 419
string|false
getLayout()
Returns current layout name.
at line 430
Presenter
setLayout($layout)
Changes or disables layout.
at line 442
void
sendTemplate()
No description
at line 473
string
findLayoutTemplateFile()
Finds layout template file name.
at line 497
array
formatLayoutTemplateFiles()
Formats layout template file names.
at line 523
array
formatTemplateFiles()
Formats view template file names.
at line 543
static string
formatActionMethod($action)
Formats action method name.
at line 554
static string
formatRenderMethod($view)
Formats render view method name.
at line 566
stdClass
getPayload()
No description
at line 576
bool
isAjax()
Is AJAX request?
at line 590
void
sendPayload()
Sends AJAX payload to the output.
at line 602
void
sendJson(mixed $data)
Sends JSON data to the output.
at line 616
void
sendResponse(IResponse $response)
Sends response and terminates presenter.
at line 628
void
terminate()
Correctly terminates presenter.
at line 645
void
forward($destination, $args = array())
Forward to another presenter or action.
at line 663
void
redirectUrl($url, $code = NULL)
Redirect to another URL and ends presenter execution.
at line 685
void
error($message = NULL, $code = Http\IResponse::S404_NOT_FOUND)
Throws HTTP error.
at line 695
string
backlink()
Link to myself.
at line 705
Request
getLastCreatedRequest()
Returns the last created Request.
at line 716
bool
getLastCreatedRequestFlag($flag)
Returns the last created Request flag.
at line 727
void
canonicalize()
Conditional redirect to canonicalized URI.
at line 748
void
lastModified($lastModified, $etag = NULL, $expire = NULL)
Attempts to cache the sent entity by its last modification date.
at line 770
protected string
createRequest($component, $destination, array $args, $mode)
internal |
Request/URL factory.
at line 1052
protected string
handleInvalidLink(InvalidLinkException $e)
Invalid link handler. Descendant can override this method to change default behaviour.
at line 1074
string
storeRequest($expiration = '+ 10 minutes')
Stores current request to session.
at line 1092
void
restoreRequest($key)
Restores request from session.
at line 1116
static array
getPersistentComponents()
Returns array of persistent components.
This default implementation detects components by class-level annotation @persistent(cmp1, cmp2).
at line 1194
protected void
saveGlobalState()
Permanently saves state information for all subcomponents to $this->globalState.
at line 1259
array
popGlobalParameters($id)
Pops parameters for specified component.
at line 1279
bool
hasFlashSession()
Checks if a flash session namespace exists.
at line 1290
SessionSection
getFlashSession()
Returns session namespace provided to pass temporary data between redirects.
at line 1302
injectPrimary(Container $context, Application $application, Context $httpContext, IRequest $httpRequest, IResponse $httpResponse, Session $session, User $user)
No description
at line 1323
SystemContainer|Container
getContext()
deprecated
deprecated
Gets the context.
at line 1332
getService($name)
deprecated
deprecated
No description
at line 1342
protected IRequest
getHttpRequest()
No description
at line 1351
protected IResponse
getHttpResponse()
No description
at line 1360
protected
getHttpContext()
deprecated
deprecated
No description
at line 1370
getApplication()
deprecated
deprecated
No description
at line 1381
Session|SessionSection
getSession($namespace = NULL)
No description
at line 1391
User
getUser()
No description