Namespaces

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

Classes

  • AppForm
  • Application
  • CliRouter
  • Control
  • DownloadResponse
  • ForwardingResponse
  • JsonResponse
  • Link
  • MultiRouter
  • Presenter
  • PresenterComponent
  • PresenterLoader
  • PresenterRequest
  • RedirectingResponse
  • RenderResponse
  • Route
  • SimpleRouter

Interfaces

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

Exceptions

  • AbortException
  • ApplicationException
  • BadRequestException
  • BadSignalException
  • ForbiddenRequestException
  • InvalidLinkException
  • InvalidPresenterException
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases

Class Presenter

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

Nette\Object
Extended by Nette\Component implements Nette\IComponent
Extended by Nette\ComponentContainer implements Nette\IComponentContainer
Extended by Nette\Application\PresenterComponent implements Nette\Application\ISignalReceiver, Nette\Application\IStatePersistent, ArrayAccess
Extended by Nette\Application\Control implements Nette\Application\IPartiallyRenderable
Extended by Nette\Application\Presenter implements Nette\Application\IPresenter
Abstract
Namespace: Nette\Application
Author: David Grudl
Located at Application/Presenter.php
Methods summary
final public Nette\Application\PresenterRequest
# getRequest( )

Returns

Nette\Application\PresenterRequest
final public Nette\Application\Presenter
# getPresenter( boolean $need = TRUE )

Returns self.

Returns self.

Parameters

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

Returns

Nette\Application\Presenter
final public string
# getUniqueId( )

Returns a name that uniquely identifies component.

Returns a name that uniquely identifies component.

Returns

string
public Nette\Application\IPresenterResponse
# run( Nette\Application\PresenterRequest $request )

Parameters

$request
Nette\Application\PresenterRequest

Returns

Nette\Application\IPresenterResponse

Implementation of

Nette\Application\IPresenter::run
protected
# startup( )
protected
# beforeRender( )

Common render method.

Common render method.

protected
# afterRender( )

Common render method.

Common render method.

protected
# shutdown( Nette\Application\IPresenterResponse $response )

Parameters

$response
Nette\Application\IPresenterResponse
optional catched exception
public
# processSignal( )

Throws

Nette\Application\BadSignalException
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 Nette\Application\Presenter
# setView( string $view )

Changes current view. Any name is allowed.

Changes current view. Any name is allowed.

Parameters

$view
string

Returns

Nette\Application\Presenter
provides a fluent interface
final public string|false
# getLayout( )

Returns current layout name.

Returns current layout name.

Returns

string|false
public Nette\Application\Presenter
# setLayout( string|false $layout )

Changes or disables layout.

Changes or disables layout.

Parameters

$layout
string|false

Returns

Nette\Application\Presenter
provides a fluent interface
public
# sendTemplate( )

Throws

Nette\Application\BadRequestException
if no template found
Nette\Application\AbortException
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

Nette\Application\AbortException
public
# forward( string|Nette\Application\PresenterRequest $destination, array|mixed $args = array() )

Forward to another presenter or action.

Forward to another presenter or action.

Parameters

$destination
string|Nette\Application\PresenterRequest
$args
array|mixed

Throws

Nette\Application\AbortException
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

Nette\Application\AbortException
public string
# backlink( )

Link to myself.

Link to myself.

Returns

string
public Nette\Application\PresenterRequest
# getLastCreatedRequest( )

Returns the last created PresenterRequest.

Returns the last created PresenterRequest.

Returns

Nette\Application\PresenterRequest
public boolean
# getLastCreatedRequestFlag( string $flag )

Returns the last created PresenterRequest flag.

Returns the last created PresenterRequest flag.

Parameters

$flag
string

Returns

boolean
public
# terminate( Nette\Application\IPresenterResponse $response = NULL )

Correctly terminates presenter.

Correctly terminates presenter.

Parameters

$response
Nette\Application\IPresenterResponse

Throws

Nette\Application\AbortException
public
# canonicalize( )

Conditional redirect to canonicalized URI.

Conditional redirect to canonicalized URI.

Throws

Nette\Application\AbortException
protected string
# handleInvalidLink( Nette\Application\InvalidLinkException $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
Nette\Application\InvalidLinkException

Returns

string

Throws

Nette\Application\InvalidLinkException
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 Nette\Web\SessionNamespace
# getFlashSession( )

Returns session namespace provided to pass temporary data between redirects.

Returns session namespace provided to pass temporary data between redirects.

Returns

Nette\Web\SessionNamespace
protected Nette\Web\HttpRequest
# getHttpRequest( )

Returns

Nette\Web\HttpRequest
protected Nette\Web\HttpResponse
# getHttpResponse( )

Returns

Nette\Web\HttpResponse
protected Nette\Web\HttpContext
# getHttpContext( )

Returns

Nette\Web\HttpContext
public Nette\Application\Application
# getApplication( )

Returns

Nette\Application\Application
protected Nette\Web\Session
# getSession( $namespace = NULL )

Returns

Nette\Web\Session
protected Nette\Web\User
# getUser( )

Returns

Nette\Web\User
Methods inherited from Nette\Application\Control
createTemplate(), flashMessage(), getSnippetId(), getTemplate(), getWidget(), invalidateControl(), isControlInvalid(), templatePrepareFilters(), validateControl()
Methods inherited from Nette\Application\PresenterComponent
__construct(), attached(), formatSignalMethod(), getParam(), getParamId(), getPersistentParams(), getReflection(), lazyLink(), link(), loadState(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), redirect(), saveState(), signalReceived(), tryCall()
Methods inherited from Nette\ComponentContainer
__clone(), addComponent(), createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent()
Methods inherited from Nette\Component
__wakeup(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent()
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod()
Constants summary
integer INVALID_LINK_SILENT 1
#

bad link handling Nette\Application\Presenter::$invalidLinkMode

bad link handling Nette\Application\Presenter::$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 Nette\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 Nette\Application\PresenterComponent
$params
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0