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

Class: KViewTemplate

Source Location: /libraries/koowa/view/template.php

Class Overview

KObject
   |
   --KViewAbstract
      |
      --KViewTemplate

Abstract Template View Class


Author(s):

Variables

Methods


Child classes:

KViewHtml
View HTML Class

Inherited Variables

Inherited Methods

Class: KViewAbstract

KViewAbstract::__construct()
Constructor
KViewAbstract::display()
Return the views output
KViewAbstract::getBaseUrl()
Get the view base url
KViewAbstract::getFormat()
Get the format
KViewAbstract::getLayout()
Get the layout.
KViewAbstract::getModel()
Get the model object attached to the contoller
KViewAbstract::getName()
Get the name
KViewAbstract::getRoute()
Get a route based on a full or partial query string
KViewAbstract::setLayout()
Sets the layout name to use
KViewAbstract::setModel()
Method to set a model object attached to the view
KViewAbstract::_initialize()
Initializes the config for the object
KViewAbstract::__toString()
Returns the views output

Class: KObject

KObject::__construct()
Constructor
KObject::get()
Get the object properties
KObject::getHandle()
Get a handle for this object
KObject::getIdentifier()
Gets the service identifier.
KObject::getMethods()
Get a list of all the available methods
KObject::getService()
Get an instance of a class based on a class identifier only creating it if it does not exist yet.
KObject::inherits()
Checks if the object or one of it's mixin's inherits from a class.
KObject::mixin()
Mixin an object
KObject::set()
Set the object properties
KObject::_initialize()
Initializes the options for the object
KObject::__call()
Search the mixin method map and call the method or trigger an error
KObject::__clone()
Preform a deep clone of the object.

Class Details

[line 19]
Abstract Template View Class



Tags:

author:  Johan Janssens <johan@nooku.org>
abstract:  
uses:  KTemplate
uses:  KService
uses:  KMixinClass


[ Top ]


Class Variables

$_auto_assign =

[line 40]

Auto assign



Tags:

access:  protected

Type:   boolean


[ Top ]

$_data =

[line 47]

The assigned data



Tags:

access:  protected

Type:   boolean


[ Top ]

$_escape =

[line 33]

Callback for escaping.



Tags:

access:  protected

Type:   string


[ Top ]

$_mediaurl =

[line 54]

The uniform resource locator



Tags:

access:  protected

Type:   object


[ Top ]

$_template =

[line 26]

Template identifier (com://APP/COMPONENT.template.NAME)



Tags:

access:  protected

Type:   string|object


[ Top ]



Class Methods


constructor __construct [line 61]

KViewTemplate __construct( $config)

Constructor



Tags:

access:  public


Overridden in child classes as:

ComDefaultViewHtml::__construct()
Constructor

Overrides KViewAbstract::__construct() (Constructor)

Parameters:

object An   $config   optional KConfig object with configuration options

[ Top ]

method assign [line 182]

KViewAbstract assign( )

Assigns variables to the view script via differing strategies.

This method is overloaded; you can assign all the properties of an object, an associative array, or a single value by name.

You are not allowed to set variables that begin with an underscore; these are either private properties for KView or private variables within the template script itself.

  1.  $view new KViewDefault();
  2.  
  3.  // assign directly
  4.  $view->var1 'something';
  5.  $view->var2 'else';
  6.  
  7.  // assign by name and value
  8.  $view->assign('var1''something');
  9.  $view->assign('var2''else');
  10.  
  11.  // assign by assoc-array
  12.  $ary array('var1' => 'something''var2' => 'else');
  13.  $view->assign($obj);
  14.  
  15.  // assign by object
  16.  $obj new stdClass;
  17.  $obj->var1 'something';
  18.  $obj->var2 'else';
  19.  $view->assign($obj);




Tags:

access:  public


[ Top ]

method display [line 217]

string display( )

Return the views output



Tags:

return:  The output of the view
access:  public


Overridden in child classes as:

KViewHtml::display()
Return the views output
ModDefaultHtml::display()
Renders and echo's the views output

Overrides KViewAbstract::display() (Return the views output)

[ Top ]

method escape [line 207]

mixed escape( mixed $var)

Escapes a value for output in a view script.



Tags:

return:  The escaped value.
access:  public


Parameters:

mixed   $var   The output to escape.

[ Top ]

method getLayout [line 265]

string getLayout( )

Get the layout.



Tags:

return:  The layout name
access:  public


Overrides KViewAbstract::getLayout() (Get the layout.)

[ Top ]

method getMediaUrl [line 331]

object A getMediaUrl( )

Get the view media url



Tags:

return:  KHttpUrl object
access:  public


[ Top ]

method getTemplate [line 275]

KTemplate getTemplate( )

Get the identifier for the template with the same name



Tags:

access:  public


[ Top ]

method setEscape [line 235]

KViewAbstract setEscape( mixed $spec)

Sets the _escape() callback.



Tags:

access:  public


Parameters:

mixed   $spec   The callback for _escape() to use.

[ Top ]

method setLayout [line 247]

KViewAbstract setLayout( string $layout)

Sets the layout name



Tags:

access:  public


Overrides KViewAbstract::setLayout() (Sets the layout name to use)

Parameters:

string   $layout   The template name.

[ Top ]

method setTemplate [line 302]

KViewAbstract setTemplate( mixed $template)

Method to set a template object attached to the view



Tags:

throws:  KDatabaseRowsetException If the identifier is not a table identifier
access:  public


Parameters:

mixed   $template   An object that implements KObjectServiceable, an object that implements KServiceIdentifierInterface or valid identifier string

[ Top ]

method _initialize [line 103]

void _initialize( $config)

Initializes the config for the object

Called from __construct() as a first step of object instantiation.




Tags:

access:  protected


Overridden in child classes as:

KViewHtml::_initialize()
Initializes the config for the object
ModDefaultHtml::_initialize()
Initializes the default configuration for the object

Overrides KViewAbstract::_initialize() (Initializes the config for the object)

Parameters:

object An   $config   optional KConfig object with configuration options

[ Top ]

method __call [line 359]

KViewAbstract __call( string $method, array $args)

Supports a simple form of Fluent Interfaces. Allows you to assign variables to the view by using the variable name as the method name. If the method name is a setter method the setter will be called instead.

For example : $view->layout('foo')->title('name')->display().




Tags:



Overrides KObject::__call() (Search the mixin method map and call the method or trigger an error)

Parameters:

string   $method   Method name
array   $args   Array containing all the arguments for the original call

[ Top ]

method __get [line 137]

string __get( string $property)

Get a view property



Tags:

return:  The property value.
access:  public


Parameters:

string   $property   The property name.

[ Top ]

method __set [line 126]

void __set( string $property, mixed $value)

Set a view properties



Tags:

access:  public


Overridden in child classes as:

ModDefaultHtml::__set()
Set a view properties

Parameters:

string   $property   The property name.
mixed   $value   The property value.

[ Top ]

method __toString [line 341]

string __toString( )

Execute and return the views output



Tags:

access:  public


Overrides KViewAbstract::__toString() (Returns the views output)

[ Top ]


Documentation generated on Sat, 18 May 2013 03:06:50 +0200 by phpDocumentor 1.4.3