Packages

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • NAppForm
  • NApplication
  • NCliRouter
  • NControl
  • NDownloadResponse
  • NForwardingResponse
  • NJsonResponse
  • NLink
  • NMultiRouter
  • NPresenter
  • NPresenterComponent
  • NPresenterLoader
  • NPresenterRequest
  • NRedirectingResponse
  • NRenderResponse
  • NRoute
  • NSimpleRouter

Interfaces

  • IPartiallyRenderable
  • IPresenter
  • IPresenterLoader
  • IPresenterResponse
  • IRenderable
  • IRouter
  • ISignalReceiver
  • IStatePersistent

Exceptions

  • NAbortException
  • NApplicationException
  • NBadRequestException
  • NBadSignalException
  • NForbiddenRequestException
  • NInvalidLinkException
  • NInvalidPresenterException
  • Overview
  • Package
  • Class
  • Tree
  • Other releases

Class NPresenter

Presenter object represents a webpage instance. It executes all the logic for the request.

NObject
Extended by NComponent implements IComponent
Extended by NComponentContainer implements IComponentContainer
Extended by NPresenterComponent implements ISignalReceiver, IStatePersistent, ArrayAccess
Extended by NControl implements IPartiallyRenderable
Extended by NPresenter implements IPresenter
Abstract
Package: Nette\Application
Author: David Grudl
Located at Application/Presenter.php
Methods summary
final public NPresenterRequest
# getRequest( )

Returns

NPresenterRequest
final public NPresenter
# getPresenter( boolean $need = TRUE )

Returns self.

Returns self.

Parameters

$need
boolean
throw exception if presenter doesn't exist?

Returns

NPresenter
final public string
# getUniqueId( )

Returns a name that uniquely identifies component.

Returns a name that uniquely identifies component.

Returns

string
public IPresenterResponse
# run( NPresenterRequest $request )

Parameters

$request
NPresenterRequest

Returns

IPresenterResponse

Implementation of

IPresenter::run
protected
# startup( )
protected
# beforeRender( )

Common render method.

Common render method.

protected
# afterRender( )

Common render method.

Common render method.

protected
# shutdown( IPresenterResponse $response )

Parameters

$response
IPresenterResponse
optional catched exception
public
# processSignal( )

Throws

NBadSignalException
final public array|null
# getSignal( )

Returns pair signal receiver and name.

Returns pair signal receiver and name.

Returns

array|null
final public boolean
# isSignalReceiver( mixed $component, string $signal = NULL )

Checks if the signal receiver is the given one.

Checks if the signal receiver is the given one.

Parameters

$component
mixed
component or its id
$signal
string
signal name (optional)

Returns

boolean
final public string
# getAction( $fullyQualified = FALSE )

Returns current action name.

Returns current action name.

Returns

string
public
# changeAction( string $action )

Changes current action. Only alphanumeric characters are allowed.

Changes current action. Only alphanumeric characters are allowed.

Parameters

$action
string
final public string
# getView( )

Returns current view.

Returns current view.

Returns

string
public NPresenter
# setView( string $view )

Changes current view. Any name is allowed.

Changes current view. Any name is allowed.

Parameters

$view
string

Returns

NPresenter
provides a fluent interface
final public string|false
# getLayout( )

Returns current layout name.

Returns current layout name.

Returns

string|false
public NPresenter
# setLayout( string|false $layout )

Changes or disables layout.

Changes or disables layout.

Parameters

$layout
string|false

Returns

NPresenter
provides a fluent interface
public
# sendTemplate( )

Throws

NBadRequestException
if no template found
NAbortException
public array
# formatLayoutTemplateFiles( string $presenter, string $layout )

Formats layout template file names.

Formats layout template file names.

Parameters

$presenter
string
$layout
string

Returns

array
public array
# formatTemplateFiles( string $presenter, string $view )

Formats view template file names.

Formats view template file names.

Parameters

$presenter
string
$view
string

Returns

array
protected static string
# formatActionMethod( string $action )

Formats action method name.

Formats action method name.

Parameters

$action
string

Returns

string
protected static string
# formatRenderMethod( string $view )

Formats render view method name.

Formats render view method name.

Parameters

$view
string

Returns

string
final public stdClass
# getPayload( )

Returns

stdClass
public boolean
# isAjax( )

Is AJAX request?

Is AJAX request?

Returns

boolean
public
# sendPayload( )

Sends AJAX payload to the output.

Sends AJAX payload to the output.

Throws

NAbortException
public
# forward( string|PresenterRequest $destination, array|mixed $args = array() )

Forward to another presenter or action.

Forward to another presenter or action.

Parameters

$destination
string|PresenterRequest
$args
array|mixed

Throws

NAbortException
public
# redirectUri( string $uri, integer $code = NULL )

Redirect to another URL and ends presenter execution.

Redirect to another URL and ends presenter execution.

Parameters

$uri
string
$code
integer
HTTP error code

Throws

NAbortException
public string
# backlink( )

Link to myself.

Link to myself.

Returns

string
public NPresenterRequest
# getLastCreatedRequest( )

Returns the last created PresenterRequest.

Returns the last created PresenterRequest.

Returns

NPresenterRequest
public boolean
# getLastCreatedRequestFlag( string $flag )

Returns the last created PresenterRequest flag.

Returns the last created PresenterRequest flag.

Parameters

$flag
string

Returns

boolean
public
# terminate( IPresenterResponse $response = NULL )

Correctly terminates presenter.

Correctly terminates presenter.

Parameters

$response
IPresenterResponse

Throws

NAbortException
public
# canonicalize( )

Conditional redirect to canonicalized URI.

Conditional redirect to canonicalized URI.

Throws

NAbortException
protected string
# handleInvalidLink( NInvalidLinkException $e )

Invalid link handler. Descendant can override this method to change default behaviour.

Invalid link handler. Descendant can override this method to change default behaviour.

Parameters

$e
NInvalidLinkException

Returns

string

Throws

NInvalidLinkException
public static array
# getPersistentComponents( )

Returns array of persistent components. This default implementation detects components by class-level annotation @persistent(cmp1, cmp2).

Returns array of persistent components. This default implementation detects components by class-level annotation @persistent(cmp1, cmp2).

Returns

array
protected
# saveGlobalState( )

Permanently saves state information for all subcomponents to $this->globalState.

Permanently saves state information for all subcomponents to $this->globalState.

final public array
# popGlobalParams( string $id )

Pops parameters for specified component.

Pops parameters for specified component.

Parameters

$id
string
component id

Returns

array
public boolean
# hasFlashSession( )

Checks if a flash session namespace exists.

Checks if a flash session namespace exists.

Returns

boolean
public NSessionNamespace
# getFlashSession( )

Returns session namespace provided to pass temporary data between redirects.

Returns session namespace provided to pass temporary data between redirects.

Returns

NSessionNamespace
protected NHttpRequest
# getHttpRequest( )

Returns

NHttpRequest
protected NHttpResponse
# getHttpResponse( )

Returns

NHttpResponse
protected NHttpContext
# getHttpContext( )

Returns

NHttpContext
public NApplication
# getApplication( )

Returns

NApplication
protected NSession
# getSession( $namespace = NULL )

Returns

NSession
protected NUser
# getUser( )

Returns

NUser
Methods inherited from NControl
createTemplate(), flashMessage(), getSnippetId(), getTemplate(), getWidget(), invalidateControl(), isControlInvalid(), templatePrepareFilters(), validateControl()
Methods inherited from NPresenterComponent
__construct(), attached(), formatSignalMethod(), getParam(), getParamId(), getPersistentParams(), getReflection(), lazyLink(), link(), loadState(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), redirect(), saveState(), signalReceived(), tryCall()
Methods inherited from NComponentContainer
__clone(), addComponent(), createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent()
Methods inherited from NComponent
__wakeup(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent()
Methods inherited from NObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod()
Constants summary
integer INVALID_LINK_SILENT 1
#

bad link handling NPresenter::$invalidLinkMode

bad link handling NPresenter::$invalidLinkMode

integer INVALID_LINK_WARNING 2
#
integer INVALID_LINK_EXCEPTION 3
#
string SIGNAL_KEY 'do'
#
string ACTION_KEY 'action'
#
string FLASH_KEY '_fid'
#
Constants inherited from IComponent
NAME_SEPARATOR
Properties summary
public static string $defaultAction 'default'
#
public static integer $invalidLinkMode
#
public array $onShutdown
#

of function(Presenter $sender, IPresenterResponse $response = NULL); Occurs when the presenter is shutting down

of function(Presenter $sender, IPresenterResponse $response = NULL); Occurs when the presenter is shutting down

public boolean $oldLayoutMode TRUE
#

(experimental)

(experimental)

public boolean $oldModuleMode TRUE
#

(experimental)

(experimental)

public boolean $autoCanonicalize TRUE
#

automatically call canonicalize()

automatically call canonicalize()

public boolean $absoluteUrls FALSE
#

use absolute Urls or paths?

use absolute Urls or paths?

Properties inherited from NPresenterComponent
$params
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0