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
mixedString name of var, or array of names.
display(string $__template) : void
get(string $name) : mixed
stringVariable name to retrieve.
mixedgetOutputDirectory() : string
stringgetTemplatePath() : string
stringparse(string $template, string $outputFile, boolean $append) : string
stringThe template filename (relative to templatePath or absolute).
stringIf specified, contents of template will also be written to this file.
booleanShould output be appended to source file?
\Exception |
- if template not found. |
|---|
stringThe "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
booleanShould 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
stringFile name or possibly absolute path.
stringThe 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