category | OSS |
---|---|
package | OSS_View |
copyright | Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland |
license | New BSD License |
__clone() : void
It automatically runs (PHP 5) after the "clone" operator did it's job. More descriptions at clearVars() .
__construct(string $tmplPath, array $extraParams) : void
string
array
__get(string $key) : mixed
string
The variable name.
mixed
The variable value.__isset(string $key) : bool
string
bool
__set(string $key, mixed $val) : void
string
The variable name.
mixed
The variable value.
__unset(string $key) : void
string
addBasePath(string $path, string $prefix) : void
string
string
Unused
assign(string | array $spec, mixed $value) : void
Allows setting a specific key to the specified value, OR passing an array of key => value pairs to set en masse.
see | \global\__set() |
---|
string
array
The assignment strategy to use (key or array of key => value pairs)
mixed
(Optional) If assigning a named variable, use this as the value.
clearVars()
Clears all variables assigned to Zend_View either via assign() or property overloading (__get()/__set()).
Both Zend_View_Helper_Action::cloneView() and Zend_View_Helper_Partial::cloneView() executes a "$view->clearVars();" line after a "$view = clone $this->view;" . Because of how the "clone" operator works internally (object references are also copied, so a clone of this object will point to the same Smarty object instance as this, the "$view->clearVars();" unsets all the Smarty template variables. To solve this, there is the __clone() method in this class which is called by the "clone" operator just after it did it's cloning job.
This sets a flag ($this->_isBeingCloned) for use below to avoid clearing the template variables in the cloned object.
If for any reason this doesn't work, neither after amending __clone(), an other "solution" is in the method, but commented out. That will also work, but it is relatively slow and, not nice at all. That takes a look on it's backtrace, and if finds a function name "cloneView" then does NOT execute Smarty's clearAllAssign().
Or just make this an empty function if neither the above works.
display(string $name) : void
string
The template to process.
getEngine() : \Smarty
\Smarty
getScriptPaths() : string
string
getSkin() : string
string
The name of the skin in use or false if default.ossAddMessage(\OSS_Message $message) : bool
registerClass(string $n, string $c)
Especially useful for classes outside the standard namespace.
From the Smarty developers:
We have decided not to integrate namespace support into the template syntax. The goal of Smarty is to speparate the design as much as possible from the business logic. With namespace syntax we would more and more of business logic into the templates.
Instead ou can register a class with optional namespace for the use in the template like:
$smarty->registerClass("FOO","\Fully\Qualified\Name\Foo");
see | \global\http://www.smarty.net/forums/viewtopic.php?p=65279 |
---|
string
The variable name for the class within the template
string
The fully qualified class name
render(string $name) : string
string
The template to process.
string
setBasePath(string $path, string $prefix) : void
string
string
Unused
setScriptPath(string $path) : void
string
The directory to set as the path.
\Exception |
If path is not readable |
---|
setSkin(string $s)
skinTemplateExists(string $name) : boolean
string
The template to look for
boolean
templateExists(string $name) : bool
string
The template to look for
bool
_run() : void
resolveTemplate(string $name) : string
If we're using skins and if a template exists in the skin, then it'll be used. Otherwise we'll use the default templates.
string
The name of the template to use
string
The resolved template name$_skin : string
$_smarty : \Smarty