Presenter
abstract class Presenter extends Control implements IPresenter
Presenter object represents a webpage instance. It executes all the logic for the request.
Constants
PHASE_STARTUP |
|
PHASE_SIGNAL |
|
PHASE_RENDER |
|
PHASE_SHUTDOWN |
|
INVALID_LINK_SILENT |
|
INVALID_LINK_WARNING |
|
INVALID_LINK_EXCEPTION |
|
SIGNAL_KEY |
|
ACTION_KEY |
|
FLASH_KEY |
|
Properties
static string | $defaultAction | ||
static int | $invalidLinkMode | ||
array | $onShutdown | ||
bool | $oldLayoutMode | ||
bool | $oldModuleMode | ||
bool | $autoCanonicalize | ||
bool | $absoluteUrls | ||
string | $view | ||
string | $layout | ||
PresenterRequest read-only | $request | ||
int read-only | $phase | ||
array read-only | $signal | ||
string read-only | $action | ||
mixed read-only | $payload | ||
Application read-only | $application |
Methods
No description
Returns self.
Returns a name that uniquely identifies component.
Returns current presenter life cycle phase.
No description
Common render method.
Common render method.
No description
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
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.
Forward to another presenter or action.
Redirect to another URL and ends presenter execution.
Link to myself.
Returns the last created PresenterRequest.
Returns the last created PresenterRequest flag.
Conditional redirect to canonicalized URI.
Attempts to cache the sent entity by its last modification date
PresenterRequest/URL factory.
Invalid link handler. Descendant can override this method to change default behaviour.
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 143
final PresenterRequest
getRequest()
No description
at line 154
final Presenter|null
getPresenter($need = TRUE)
Returns self.
at line 165
final string
getUniqueId()
Returns a name that uniquely identifies component.
at line 180
IPresenterResponse
run(PresenterRequest $request)
No description
at line 272
final int
getPhase()
Returns current presenter life cycle phase.
at line 282
protected void
startup()
No description
at line 293
protected void
beforeRender()
Common render method.
at line 303
protected void
afterRender()
Common render method.
at line 313
protected void
shutdown($response)
No description
at line 327
void
processSignal()
No description
at line 354
final array|null
getSignal()
Returns pair signal receiver and name.
at line 367
final bool
isSignalReceiver($component, $signal = NULL)
Checks if the signal receiver is the given one.
at line 398
final string
getAction($fullyQualified = FALSE)
Returns current action name.
at line 410
void
changeAction($action)
Changes current action. Only alphanumeric characters are allowed.
at line 427
final string
getView()
Returns current view.
at line 439
Presenter
setView($view)
Changes current view. Any name is allowed.
at line 451
final string|false
getLayout()
Returns current layout name.
at line 463
Presenter
setLayout($layout)
Changes or disables layout.
at line 476
void
sendTemplate()
No description
at line 531
array
formatLayoutTemplateFiles($presenter, $layout)
Formats layout template file names.
at line 575
array
formatTemplateFiles($presenter, $view)
Formats view template file names.
at line 611
static protected string
formatActionMethod($action)
Formats action method name.
at line 623
static protected string
formatRenderMethod($view)
Formats render view method name.
at line 633
protected
renderTemplate()
deprecated
deprecated
No description
at line 647
final stdClass
getPayload()
No description
at line 658
bool
isAjax()
Is AJAX request?
at line 673
protected void
sendPayload()
Sends AJAX payload to the output.
at line 683
getAjaxDriver()
deprecated
deprecated
No description
at line 701
void
forward($destination, $args = array())
Forward to another presenter or action.
at line 724
void
redirectUri($uri, $code = NULL)
Redirect to another URL and ends presenter execution.
at line 742
string
backlink()
Link to myself.
at line 753
PresenterRequest
getLastCreatedRequest()
Returns the last created PresenterRequest.
at line 765
bool
getLastCreatedRequestFlag($flag)
Returns the last created PresenterRequest flag.
at line 778
void
terminate(IPresenterResponse $response = NULL)
Correctly terminates presenter.
at line 791
void
canonicalize()
Conditional redirect to canonicalized URI.
at line 811
int
lastModified($lastModified, $etag = NULL, $expire = NULL)
Attempts to cache the sent entity by its last modification date
at line 884
final protected string
createRequest($component, $destination, array $args, $mode)
internal |
PresenterRequest/URL factory.
at line 1105
protected string
handleInvalidLink($e)
Invalid link handler. Descendant can override this method to change default behaviour.
at line 1134
static array
getPersistentComponents()
Returns array of persistent components.
This default implementation detects components by class-level annotation @persistent(cmp1, cmp2).
at line 1218
protected void
saveGlobalState()
Permanently saves state information for all subcomponents to $this->globalState.
at line 1286
final array
popGlobalParams($id)
Pops parameters for specified component.
at line 1308
bool
hasFlashSession()
Checks if a flash session namespace exists.
at line 1320
SessionNamespace
getFlashSession()
Returns session namespace provided to pass temporary data between redirects.
at line 1337
protected IHttpRequest
getHttpRequest()
No description
at line 1347
protected IHttpResponse
getHttpResponse()
No description
at line 1357
Application
getApplication()
No description
at line 1367
protected Session
getSession($namespace = NULL)
No description
at line 1377
protected User
getUser()
No description