Capsule is a simple "template" engine that essentially provides an isolated context for PHP scripts.
There is no special templating language, and therefore no limitations to what can be accomplished within templates. The main purpose of Capsule is to separate the business logic from display / output logic.
author | Hans Lellelid |
---|---|
version | $Id$ |
package | phing.lib |
__construct()
clear(mixed $which) : void
mixed
String name of var, or array of names.
display(string $__template) : void
get(string $name) : mixed
string
Variable name to retrieve.
mixed
getOutputDirectory() : string
string
getTemplatePath() : string
string
parse(string $template, string $outputFile, boolean $append) : string
string
The template filename (relative to templatePath or absolute).
string
If specified, contents of template will also be written to this file.
boolean
Should output be appended to source file?
\Exception |
- if template not found. |
---|
string
The "parsed" template output.put(string $name, mixed $value)
Resulting template will have access to ${$name$} variable.
string
mixed
putAll(array $vars, boolean $recursiveMerge) : void
Given an array like:
array( 'myvar' => 'Hello',
'myvar2' => 'Hello')
Resulting template will have access to $myvar and $myvar2.
array
boolean
Should matching keys be recursively merged?
putCopy(string $name, mixed $value)
This is primarily to force copying (cloning) of objects, rather than the default behavior which is to assign them by reference.
string
mixed
putRef($name, \$value $value)
This means that if the template modifies the variable, then it will also be modified in the context.
\$value
setOutputDirectory(string $v)
string
setTemplatePath(string $v)
string
resolvePath(string $file, string $basepath) : string
string
File name or possibly absolute path.
string
The basepath that should be prepended if $file is not absolute.
string
"Best guess" path for this file.$vars : array
$initialized
$outputDirectory : string
$templatePath : string
$old_include_path : string