mojavi
[ class tree: mojavi ] [ index: mojavi ] [ all elements ]

Class: View

Source Location: /view/View.class.php

Class Overview

MojaviObject
   |
   --View

A view represents the presentation layer of an action. Output can be customized by supplying attributes, which a template can manipulate and display.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: View.class.php 755 2005-01-27 19:36:09Z seank $

Copyright:

Variables

Constants

Methods


Child classes:

SmartyView
$Id: SmartyView.class.php 65 2004-10-26 03:16:15Z seank $
PHPView
A view that uses PHP to render templates.

Inherited Methods

Class: MojaviObject

MojaviObject::toString()
Retrieve a string representation of this object.

Class Details

[line 25]
A view represents the presentation layer of an action. Output can be customized by supplying attributes, which a template can manipulate and display.



Tags:

abstract:  
version:  $Id: View.class.php 755 2005-01-27 19:36:09Z seank $
since:  1.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Variables

$decorator =  false

[line 94]


Type:   mixed


[ Top ]

$decoratorDirectory =  null

[line 95]


Type:   mixed


[ Top ]

$decoratorTemplate =  null

[line 96]


Type:   mixed


[ Top ]

$directory =  null

[line 97]


Type:   mixed


[ Top ]

$slots = array()

[line 98]


Type:   mixed


[ Top ]

$template =

[line 99]


Type:   mixed


[ Top ]



Class Methods


method clearAttributes [line 114]

void clearAttributes( )

Clear all attributes associated with this view.



Tags:

abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::clearAttributes()
Clear all attributes associated with this view.

[ Top ]

method decorate [line 129]

string &decorate( string &$content)

Loop through all template slots and fill them in with the results of presentation data.



Tags:

return:  A decorated template.
access:  protected
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::decorate()
Loop through all template slots and fill them in with the results of presentation data.

Parameters:

string   &$content   A chunk of decorator content.

[ Top ]

method execute [line 191]

void execute( )

Execute any presentation logic and set template attributes.



Tags:

abstract:  
since:  1.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getAttribute [line 206]

mixed &getAttribute( string $name)

Retrieve an attribute.



Tags:

return:  An attribute value, if the attribute exists, otherwise null.
abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::getAttribute()
Retrieve an attribute.

Parameters:

string   $name   An attribute name.

[ Top ]

method getAttributeNames [line 218]

array getAttributeNames( )

Retrieve an array of attribute names.



Tags:

return:  An indexed array of attribute names.
abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::getAttributeNames()
Retrieve an array of attribute names.

[ Top ]

method getContext [line 230]

Context getContext( )

Retrieve the current application context.



Tags:

return:  The current Context instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getDecoratorDirectory [line 248]

string getDecoratorDirectory( )

Retrieve this views decorator template directory.



Tags:

return:  An absolute filesystem path to this views decorator template directory.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getDecoratorTemplate [line 266]

string getDecoratorTemplate( )

Retrieve this views decorator template.



Tags:

return:  A template filename, if a template has been set, otherwise null.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getDirectory [line 284]

string getDirectory( )

Retrieve this views template directory.



Tags:

return:  An absolute filesystem path to this views template directory.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getEngine [line 300]

mixed &getEngine( )

Retrieve the template engine associated with this view.

Note: This will return null for PHPView instances.




Tags:

return:  A template engine instance.
abstract:  


Overridden in child classes as:

PHPView::getEngine()
Retrieve the template engine associated with this view.

[ Top ]

method getSlots [line 312]

array &getSlots( )

Retrieve an array of specified slots for the decorator template.



Tags:

return:  An associative array of decorator slots.
access:  protected
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getTemplate [line 330]

string getTemplate( )

Retrieve this views template.



Tags:

return:  A template filename, if a template has been set, otherwise null.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method importAttributes [line 354]

void importAttributes( array $names, [bool $files = false], [bool $errors = true], [bool $stripTags = true], [bool $specialChars = true])

Import parameter values and error messages from the request directly as view attributes.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

array   $names   An indexed array of file/parameter names.
bool   $files   Is this a list of files?
bool   $errors   Import error messages too?
bool   $stripTags   Run strip_tags() on attribute value?
bool   $specialChars   Run htmlspecialchars() on attribute value?

[ Top ]

method initialize [line 491]

bool initialize( Context $context)

Initialize this view.



Tags:

return:  true, if initialization completes successfully, otherwise false.
access:  public
since:  2.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

Context   $context   The current application context.

[ Top ]

method isDecorator [line 517]

bool isDecorator( )

Indicates that this view is a decorating view.



Tags:

return:  true, if this view is a decorating view, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method preRenderCheck [line 537]

void preRenderCheck( )

Execute a basic pre-render check to verify all required variables exist and that the template is readable.



Tags:

access:  protected
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  RenderException If the pre-render check fails.


[ Top ]

method removeAttribute [line 599]

mixed &removeAttribute( string $name)

Remove an attribute.



Tags:

return:  An attribute value, if the attribute was removed, otherwise null.
abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::removeAttribute()
Remove an attribute.

Parameters:

string   $name   An attribute name.

[ Top ]

method render [line 616]

string &render( )

Render the presentation.

When the controller render mode is View::RENDER_CLIENT, this method will render the presentation directly to the client and null will be returned.




Tags:

return:  A string representing the rendered presentation, if the controller render mode is View::RENDER_VAR, otherwise null.
abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::render()
Render the presentation.

[ Top ]

method setAttribute [line 631]

void setAttribute( string $name, mixed $value)

Set an attribute.



Tags:

abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::setAttribute()
Set an attribute.

Parameters:

string   $name   An attribute name.
mixed   $value   An attribute value.

[ Top ]

method setAttributeByRef [line 646]

void setAttributeByRef( string $name, mixed &$value)

Set an attribute by reference.



Tags:

abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::setAttributeByRef()
Set an attribute by reference.

Parameters:

string   $name   An attribute name.
mixed   &$value   A reference to an attribute value.

[ Top ]

method setAttributes [line 661]

void setAttributes( array $values)

Set an array of attributes.



Tags:

abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::setAttributes()
Set an array of attributes.

Parameters:

array   $values   An associative array of attributes and their associated values.

[ Top ]

method setAttributesByRef [line 676]

void setAttributesByRef( array &$values)

Set an array of attributes by reference.



Tags:

abstract:  
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overridden in child classes as:

PHPView::setAttributesByRef()
Set an array of attributes by reference.

Parameters:

array   &$values   An associative array of attributes and references to their associated values.

[ Top ]

method setDecoratorDirectory [line 690]

void setDecoratorDirectory( string $directory)

Set the decorator template directory for this view.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $directory   An absolute filesystem path to a template directory.

[ Top ]

method setDecoratorTemplate [line 712]

void setDecoratorTemplate( string $template)

Set the decorator template for this view.

If the template path is relative, it will be based on the currently executing module's template sub-directory.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $template   An absolute or relative filesystem path to a template.

[ Top ]

method setDirectory [line 745]

void setDirectory( string $directory)

Set the template directory for this view.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $directory   An absolute filesystem path to a template directory.

[ Top ]

method setSlot [line 769]

void setSlot( string $attributeName, string $moduleName, string $actionName)

Set the module and action to be executed in place of a particular template attribute.

If a slot with the name already exists, it will be overridden.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $attributeName   A template attribute name.
string   $moduleName   A module name.
string   $actionName   An action name.

[ Top ]

method setTemplate [line 793]

void setTemplate( string $template)

Set the template for this view.

If the template path is relative, it will be based on the currently executing module's template sub-directory.




Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

string   $template   An absolute or relative filesystem path to a template.

[ Top ]


Class Constants

ALERT =  'Alert'

[line 37]

Show an alert view.



Tags:

since:  3.0.0

[ Top ]

ERROR =  'Error'

[line 44]

Show an error view.



Tags:

since:  3.0.0

[ Top ]

INPUT =  'Input'

[line 51]

Show a form input view.



Tags:

since:  3.0.0

[ Top ]

NONE =  null

[line 58]

Skip view execution.



Tags:

since:  3.0.0

[ Top ]

RENDER_CLIENT =  2

[line 72]

Render the presentation to the client.



Tags:

since:  3.0.0

[ Top ]

RENDER_NONE =  1

[line 79]

Do not render the presentation.



Tags:

since:  3.0.0

[ Top ]

RENDER_VAR =  4

[line 86]

Render the presentation to a variable.



Tags:

since:  3.0.0

[ Top ]

SUCCESS =  'Success'

[line 65]

Show a success view.



Tags:

since:  3.0.0

[ Top ]



Documentation generated on Tue, 21 Feb 2006 01:45:31 +0900 by phpDocumentor 1.3.0RC5