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 hans@xmpl.org |
---|---|
package |
phing.lib |
__construct()
clear(mixed $which = null) : void
mixed
String name of var, or array of names.
display(string $__template) : void
throws |
|
---|
string
get(string $name) : mixed
string
Variable name to retrieve.
mixed
getOutputDirectory() : string
string
getTemplatePath() : string
string
parse(string $template, string $outputFile = null, boolean $append = false) : string
throws |
|
---|
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?
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 = false) : 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)
This means that if the template modifies the variable, then it will also be modified in the context.
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.
setOutputDirectory(string $v)
string
setTemplatePath(string $v)
string
templatePath : string
var |
---|
string
outputDirectory : string
var |
---|
string
vars : array
var |
Hash of variables. |
---|
array
initialized : boolean
var |
---|
boolean
old_include_path : string
var |
---|
string