Class Horde_View_Base
Abstract base class for Horde_View to get private constructs out of
template scope.
Methods summary
public
|
#
__construct( array $config = array() )
Constructor.
Parameters
- $config
- Configuration key-value pairs.
|
public
null
|
#
__get( mixed $name )
Undefined variables return null.
Undefined variables return null.
Returns
null
|
public
string
|
#
__call( string $method, array $args )
Accesses a helper object from within a template.
Accesses a helper object from within a template.
Parameters
- $method
- The helper method.
- $args
- The parameters for the helper.
Returns
string The result of the helper method.
Throws
|
public
|
#
addTemplatePath( string|array $path )
Adds to the stack of template paths in LIFO order.
Adds to the stack of template paths in LIFO order.
Parameters
- $path
- directory (-ies) to add.
|
public
|
#
setTemplatePath( string|array $path )
Resets the stack of template paths.
Resets the stack of template paths.
To clear all paths, use Horde_View::setTemplatePath(null).
Parameters
- $path
- directory (-ies) to set as the path.
|
public
array
|
#
getTemplatePaths( )
Returns the template paths.
Returns the template paths.
Returns
array The stack of current template paths.
|
public
Horde_View_Helper
|
#
addHelper( Horde_View_Helper|string $helper )
Adds to the stack of helpers in LIFO order.
Adds to the stack of helpers in LIFO order.
If the $helper parameter is a string instead of a Helper instance, then
it will be treated as a class name. Names without "" and that do not
have "Helper" in them will be prefixed with Horde_View_Helper; other
names will be treated as literal class names. Examples:
$v->addHelper('Tag');
$v->addHelper('AppHelper');
Parameters
- $helper
- The helper instance to add.
Returns
Horde_View_Helper Returns the helper object that was added.
Throws
|
public
|
#
assign( array $array )
Assigns multiple variables to the view.
Assigns multiple variables to the view.
The array keys are used as names, each assigned their corresponding
array value.
Parameters
- $array
- The array of key/value pairs to assign.
|
public
string
|
#
render( string $name, mixed $locals = array() )
Processes a template and returns the output.
Processes a template and returns the output.
Parameters
- $name
- The template to process.
- $locals
-
Returns
string The template output.
|
public
string
|
#
renderPartial( string $name, array $options = array() )
Renders a partial template.
Renders a partial template.
Partial template filenames are named with a leading underscore, although
this underscore is not used when specifying the name of the partial.
We would reference the file /views/shared/_sidebarInfo.html in our
template using:
<div>
<?php echo $this->renderPartial('sidebarInfo') ?>
</div>
Parameters
Returns
string The template output.
|
public
|
#
setEncoding( string $encoding )
Sets the output encoding.
Sets the output encoding.
Parameters
- $encoding
- A character set name.
|
public
string
|
#
getEncoding( )
Returns the current output encoding.
Returns the current output encoding.
Returns
string The current character set.
|
public
|
#
throwOnHelperCollision( boolean $throw = true )
Controls the behavior when a helper method is overridden by another
helper.
Controls the behavior when a helper method is overridden by another
helper.
Parameters
- $throw
- Throw an exception when helper methods collide?
|