Class PageController

Description

Page controller is special controller that is able to map controller name and actions name with layout and template and automaticly display them.

This behaviour is present only when action has not provided any exit by itself (redirect to another page, render template and die etc)

  • version: 1.0
  • abstract:

Located in /environment/classes/controller/PageController.class.php (line 11)

Controller
   |
   --PageController
Direct descendents
Class Description
ErrorController Error controller is here to display critical errors to the user when system is unable to serve users requests (failed to connect to database, unknown controller etc)
FeedController Feed controller is used to handle all feed related events - iCal, RSS etc
ApplicationController Base application controller
Method Summary
null __construct (void 0)
null addHelper (string $helper)
null execute (string $action)
boolean getAutoRender (null 0)
array getHelpers (null 0)
string getLayout (null 0)
string getLayoutPath (void 0)
string getTemplate (null 0)
string getTemplatePath (void 0)
null redirectTo ([string $controller = DEFAULT_CONTROLLER], [string $action = DEFAULT_ACTION], [array $params = null], [string $anchor = null])
null redirectToReferer (string $alternative)
null redirectToUrl (string $url)
boolean render ([string $template = null], [string $layout = null], [boolean $die = true])
boolean renderLayout (string $layout_path, [string $content = null])
null renderText (string $text, [boolean $render_layout = false])
null setAutoRender (boolean $value)
null setLayout (string $value)
null setTemplate (string $value)
Methods
Constructor __construct (line 47)

Construct controller

null __construct (void 0)
  • void 0

Redefinition of:
Controller::__construct()
Contruct controller and set controller name

Redefined in descendants as:
addHelper (line 231)

Add one or many helpers

null addHelper (string $helper)
  • string $helper: This param can be array of helpers
execute (line 61)

Execute action

null execute (string $action)
  • string $action

Redefinition of:
Controller::execute()
Execute specific controller action
getAutoRender (line 250)

Get auto_render

boolean getAutoRender (null 0)
  • null 0
getHelpers (line 221)

Return helper / helpers array

array getHelpers (null 0)
  • null 0
getLayout (line 201)

Get layout

string getLayout (null 0)
  • null 0
getLayoutPath (line 298)

Return path of the layout file. File dnx throw exception

  • throws: FileDnxError
string getLayoutPath (void 0)
  • void 0
getTemplate (line 181)

Get template

string getTemplate (null 0)
  • null 0
getTemplatePath (line 271)

Return path of the template. If template dnx throw exception

  • throws: FileDnxError
string getTemplatePath (void 0)
  • void 0
redirectTo (line 147)

Redirect. Params are same as get_url function

null redirectTo ([string $controller = DEFAULT_CONTROLLER], [string $action = DEFAULT_ACTION], [array $params = null], [string $anchor = null])
  • string $controller
  • string $action
  • array $params
  • string $anchor
redirectToReferer (line 167)

Redirect to referer. If referer is no valid this function will use $alternative URL

null redirectToReferer (string $alternative)
  • string $alternative: Alternative URL
redirectToUrl (line 157)

Redirect to URL

null redirectToUrl (string $url)
  • string $url
render (line 81)

Render content... If template and/layout are NULL script will resolve their names based on controller name and action.

PageController::index will map with:

  • template => views/page/index.php
  • layout => layouts/page.php

  • throws: FileDnxError
boolean render ([string $template = null], [string $layout = null], [boolean $die = true])
  • string $template
  • string $layout
  • boolean $die
renderLayout (line 114)

Assign content and render layout

  • throws: FileDnxError
boolean renderLayout (string $layout_path, [string $content = null])
  • string $layout_path: Path to the layout file
  • string $content: Value that will be assigned to the $content_for_layout variable
renderText (line 127)

Shortcut method for printing text and setting auto_render option

null renderText (string $text, [boolean $render_layout = false])
  • string $text: Text that need to be rendered
  • boolean $render_layout: Render controller layout. Default is false for simple and fast text rendering
setAutoRender (line 260)

Set auto_render value

null setAutoRender (boolean $value)
  • boolean $value
setLayout (line 211)

Set layout value

null setLayout (string $value)
  • string $value
setTemplate (line 191)

Set template value

null setTemplate (string $value)
  • string $value

Inherited Methods

Inherited From Controller

Controller::__construct()
Controller::execute()
Controller::forward()
Controller::getAction()
Controller::getControllerName()
Controller::getSystemControllerClass()
Controller::setAction()
Controller::setControllerName()
Controller::setSystemControllerClass()
Controller::validAction()

Documentation generated on Wed, 23 Jan 2008 01:58:59 +0000 by phpDocumentor 1.4.0