[ Index ]
 

Code source de CakePHP 1.1.13.4450

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cake/libs/view/ -> view.php (sommaire)

Methods for displaying presentation data in the view. PHP versions 4 and 5

Copyright: Copyright 2005-2007, Cake Software Foundation, Inc.
License: http://www.opensource.org/licenses/mit-license.php The MIT License
Version: $Revision: 4409 $
Poids: 716 lignes (21 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

View:: (13 méthodes):
  __construct()
  render()
  renderElement()
  element()
  renderLayout()
  setLayout()
  error()
  _getViewFileName()
  _getLayoutFileName()
  _render()
  _loadHelpers()
  pluginView()
  renderCache()


Classe: View  - X-Ref

View, the V in the MVC triad.

Class holding methods for displaying presentation data.

__construct(&$controller)   X-Ref
Constructor

Instance is created in Controller::render() and is never called directly


render($action = null, $layout = null, $file = null)   X-Ref
Renders view for given action and layout. If $file is given, that is used
for a view filename (e.g. customFunkyView.thtml).

param: string $action Name of action to render for
param: string $layout Layout to use
param: string $file Custom filename for view
return: mixed returns an error if View::render() fails to find a related template.

renderElement($name, $params = array()   X-Ref
Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.

This realizes the concept of Elements, (or "partial layouts")
and the $params array is used to send data to be used in the Element.

param: string $name Name of template file in the/app/views/elements/ folder
param: array $params Array of data to be made available to the for rendered view (i.e. the Element)
return: string Rendered output

element($name, $params = array()   X-Ref
Wrapper for View::renderElement();

param: string $name Name of template file in the/app/views/elements/ folder
param: array $params Array of data to be made available to the for rendered view (i.e. the Element)
return: string View::renderElement()

renderLayout($contentForLayout)   X-Ref
Renders a layout. Returns output from _render(). Returns false on error.

param: string $contentForLayout Content to render in a view, wrapped by the surrounding layout.
return: mixed Rendered output, or false on error

setLayout($layout)   X-Ref
Sets layout to be used when rendering.

param: string $layout Name of layout.
return: void

error($code, $name, $message)   X-Ref
Displays an error page to the user. Uses layouts/error.html to render the page.

param: int $code HTTP Error code (for instance: 404)
param: string $name Name of the error (for instance: Not Found)
param: string $message Error message as a web page
return: rendered error message

_getViewFileName($action)   X-Ref
Returns filename of given action's template file (.thtml) as a string. CamelCased action names will be under_scored! This means that you can have LongActionNames that refer to long_action_names.thtml views.

param: string $action Controller action to find template filename for
return: string Template filename

_getLayoutFileName()   X-Ref
Returns layout filename for this template as a string.

return: string Filename for layout file (.thtml).

_render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false)   X-Ref
Renders and returns output for given view filename with its array of data.

param: string $___viewFn Filename of the view
param: array $___dataForView Data to include in rendered view
return: string Rendered output

_loadHelpers(&$loaded, $helpers)   X-Ref
Loads helpers, with their dependencies.

param: array $loaded List of helpers that are already loaded.
param: array $helpers List of helpers to load.
return: array

pluginView($action, $layout)   X-Ref
Returns a plugin view

param: string $action Name of action to render for
param: string $layout Layout to use
return: mixed View::render() if template is found, error if template is missing

renderCache($filename, $timeStart)   X-Ref
Renders a cached view if timestamp in file is less or equal to current time.

If $layout is xml content type will be set before rendering the cache

param: string $filename
param: int $timeStart
return: mixed outputs view, or returns void if timestamp has expired



Généré le : Sun Feb 25 19:27:47 2007 par Balluche grâce à PHPXref 0.7