static $_instance = null
[line 122]
Singleton instance
Singleton instance
Tags:
$debug = false
[line 28]
If set, echo assignments
If set, echo assignments
Tags:
$debugBlock = false
[line 34]
If set, echo blocks time parse
If set, echo blocks time parse
Tags:
$endTime = array()
[line 115]
End time
End time
Tags:
$file = array()
[line 46]
$file[handle] = 'filename';
$file[handle] = 'filename';
Tags:
$fileFallbacks = array()
[line 52]
fallback paths that should be defined in a child class
fallback paths that should be defined in a child class
Tags:
$filenameComments = false
[line 95]
Determines whether Template outputs filename comments.
Determines whether Template outputs filename comments. false = no filename outputs true = HTML comments (e.g. <!-- START FILE $filename -->) placed in output
Tags:
$haltOnError = 'yes'
[line 80]
'yes' => halt,
'yes' => halt, 'report' => report error, continue, 'no' => ignore error quietly
Tags:
$lastError = ''
[line 87]
The last error message is retained here
The last error message is retained here
Tags:
$root = '..'
[line 40]
Relative filenames are relative to this pathname
Relative filenames are relative to this pathname
Tags:
$start_time = array()
[line 109]
Start time
Start time
Tags:
$unknownRegexp = 'loose'
[line 103]
Determines the regular expression used to find unknown variable tags.
Determines the regular expression used to find unknown variable tags. 'loose' = traditional match all curly braces with no whitespace between 'strict' = adopts PHP's variable naming rules
Tags:
$unknowns = 'remove'
[line 72]
'remove' => remove undefined variables
'remove' => remove undefined variables 'comment' => replace undefined variables with comments 'keep' => keep undefined variables
Tags:
$varkeys = array()
[line 58]
$varkeys[key] = 'key'
$varkeys[key] = 'key'
Tags:
$varvals = array()
[line 64]
$varvals[key] = 'value';
$varvals[key] = 'value';
Tags:
static method getInstance [line 153]
static Dot_Template getInstance(
[string
$root = '.'], [string
$unknowns = 'remove'], [array
$fallback = ''])
|
|
Returns an instance of Dot_View
Returns an instance of Dot_View Singleton pattern implementation
Tags:
Overridden in child classes as:
- View::getInstance()
- Returns an instance of Dot_View
Parameters:
constructor __construct [line 131]
void __construct(
[string
$root = '.'], [string
$unknowns = 'remove'], [array
$fallback = ''])
|
|
Singleton pattern implementation makes 'new' unavailable
Singleton pattern implementation makes 'new' unavailable
Tags:
Overridden in child classes as:
- Page_View::__construct()
- Constructor
- User_View::__construct()
- Constructor
Parameters:
method endTimer [line 199]
float endTimer(
$varname)
|
|
Return the end time
Return the end time
Tags:
Parameters:
method exists [line 226]
bool exists(
string|array
$var)
|
|
Inspired From PEAR HTML_Template_PHPLIB 1. Checks if the given variable exists.
Inspired From PEAR HTML_Template_PHPLIB 1.4.0 Checks if the given variable exists. When an array is given, it is checked if all variables exist.
Tags:
Parameters:
method filename [line 730]
string filename(
string
$filename)
|
|
When called with a relative pathname, this function will return the pathname with $this->root prepended.
When called with a relative pathname, this function will return the pathname with $this->root prepended. Absolute pathnames are returned unchanged. RETURNS: a string containing an absolute pathname. USAGE: filename(string $filename)
Tags:
Parameters:
method finish [line 675]
string finish(
string
$str)
|
|
Returns the finished version of $str.
Returns the finished version of $str. USAGE: finish(string $str)
Tags:
Parameters:
method get [line 716]
void get(
string
$varname)
|
|
Returns the finished version of the value of the variable named by $varname.
Returns the finished version of the value of the variable named by $varname. USAGE: get(string $varname)
Tags:
Parameters:
method getLastError [line 857]
boolean|string getLastError(
)
|
|
Returns the last error message if any
Returns the last error message if any
Tags:
method getUndefined [line 637]
array getUndefined(
string
$varname)
|
|
Returns a hash of unresolved variable names in $varname, keyed by their names (that is, the hash has the form $a[$name] = $name).
Returns a hash of unresolved variable names in $varname, keyed by their names (that is, the hash has the form $a[$name] = $name). USAGE: getUndefined(string $varname)
Tags:
Parameters:
method getVar [line 603]
mixed getVar(
mixed
$varname)
|
|
Returns the value of the variable named by $varname.
Returns the value of the variable named by $varname. If $varname references a file and that file has not been loaded yet, the variable will be reported as empty. When called with an array of variable names this public function will return a a hash of variable values keyed by their names. USAGE: getVar(string $varname) or USAGE: getVar(array $varname)
Tags:
Parameters:
method getVars [line 581]
Returns an associative array of all defined variables with the name as the key and the value of the variable as the value.
Returns an associative array of all defined variables with the name as the key and the value of the variable as the value. This is mostly useful for debugging. Also note that $this->debug can be used to echo all variable assignments as they occur and to trace execution. USAGE: getVars()
Tags:
method halt [line 816]
Is called whenever an error occurs and will handle the error according to the policy defined in $this->haltOnError. in $this->lastError.
Is called whenever an error occurs and will handle the error according to the policy defined in $this->haltOnError. Additionally the error message will be saved in $this->lastError. USAGE: halt(string $msg)
Tags:
Parameters:
method haltMsg [line 838]
void haltMsg(
string
$msg)
|
|
Prints an error message.
Prints an error message. It can be overridden by your subclass of Template. It will be called with an error message to display. USAGE: haltMsg(string $msg)
Tags:
Parameters:
method initBlock [line 934]
bool initBlock(
mixed
$target, [mixed
$value = ''], [
$append = false], string
$name)
|
|
Initialize a block A variable $parent may contain a variable block defined by: <!-- BEGIN $varname --> content <!-- END $varname -->.
Initialize a block A variable $parent may contain a variable block defined by: <!-- BEGIN $varname --> content <!-- END $varname -->. This public function removes that block from $parent and replaces it with a variable reference named $name. The block is inserted into the varkeys and varvals hashes. If $name is omitted, it is assumed to be the same as $varname. Blocks may be nested but care must be taken to extract the blocks in order from the innermost block to the outermost block. USAGE: setBlock(string $parent, string $varname, [string $name = ''])
Tags:
Parameters:
method initVar [line 888]
void initVar(
mixed
$varname, [mixed
$value = ''], [bool
$append = false])
|
|
Initialize the value of a variable.
Initialize the value of a variable. It may be called with either a varname and a value as two strings or an an associative array with the key being the varname and the value being the new variable value. The public function inserts the new value of the variable into the $varkeys and $varvals hashes. It is not necessary for a variable to exist in these hashes before calling this public function. An optional third parameter allows the value for each varname to be appended to the existing variable instead of replacing it. The default is to replace. USAGE: initVar(string $varname, [string $value = ''], [boolean $append = false]) or USAGE: initVar(array $varname = (string $varname => string $value), [mixed $dummy_var], [boolean $append = false]) or USAGE: initVar(array $varname = (string $value), [mixed $dummy_var], [boolean $append = false])
Tags:
Parameters:
method loadFile [line 779]
bool loadFile(
string
$varname)
|
|
If a variable's value is undefined and the variable has a filename stored in $this->file[$varname] then the backing file will be loaded and the file's contents will be assigned as the variable's value.
If a variable's value is undefined and the variable has a filename stored in $this->file[$varname] then the backing file will be loaded and the file's contents will be assigned as the variable's value. USAGE: loadFile(string $varname)
Tags:
Parameters:
method p [line 705]
Prints the finished version of the value of the variable named by $varname.
Prints the finished version of the value of the variable named by $varname. USAGE: p(string $varname)
Tags:
Parameters:
method parse [line 510]
mixed parse(
string
$target, mixed
$varname, [bool
$append = false])
|
|
Substitutes the values of all defined variables in the variable named $varname and stores or appends the result in the variable named $target.
Substitutes the values of all defined variables in the variable named $varname and stores or appends the result in the variable named $target. It may be called with either a target and a varname as two strings or a target as a string and an array of variable names in varname. The public function inserts the new value of the variable into the $varkeys and $varvals hashes. It is not necessary for a variable to exist in these hashes before calling this public function. An optional third parameter allows the value for each varname to be appended to the existing target variable instead of replacing it. The default is to replace. If $target and $varname are both strings, the substituted value of the variable $varname is inserted into or appended to $target. If $handle is an array of variable names the variables named by $handle are sequentially substituted and the result of each substitution step is inserted into or appended to in $target. The resulting substitution is available in the variable named by $target, as is each intermediate step for the next $varname in sequence. Note that while it is possible, it is only rarely desirable to call this public function with an array of varnames and with $append = true. USAGE: parse(string $target, string $varname, [boolean $append]) or USAGE: parse(string $target, array $varname = (string $varname), [boolean $append])
Tags:
Parameters:
method pparse [line 557]
bool pparse(
string
$target, mixed
$varname, [bool
$append = false])
|
|
This is shorthand for print $this->parse(.
This is shorthand for print $this->parse(...) and is public functionally identical. USAGE: pparse(string $target, string $varname, [boolean $append]) or USAGE: pparse(string $target, array $varname = (string $varname), [boolean $append])
Tags:
Parameters:
method psubst [line 476]
bool psubst(
string
$varname)
|
|
This is shorthand for print $this->subst($varname).
This is shorthand for print $this->subst($varname). See subst for further details. USAGE: psubst(string $varname)
Tags:
Parameters:
method setBlock [line 301]
bool setBlock(
string
$parent, string
$varname, [string
$name = ''])
|
|
A variable $parent may contain a variable block defined by: <!-- BEGIN $varname --> content <!-- END $varname -->.
A variable $parent may contain a variable block defined by: <!-- BEGIN $varname --> content <!-- END $varname -->. This public function removes that block from $parent and replaces it with a variable reference named $name. The block is inserted into the varkeys and varvals hashes. If $name is omitted, it is assumed to be the same as $varname. Blocks may be nested but care must be taken to extract the blocks in order from the innermost block to the outermost block. USAGE: setBlock(string $parent, string $varname, [string $name = ''])
Tags:
Parameters:
method setFile [line 256]
bool setFile(
string
$varname, [string
$filename = ''])
|
|
Defines a filename for the initial value of a variable.
Defines a filename for the initial value of a variable. It may be passed either a varname and a file name as two strings or a hash of strings with the key being the varname and the value being the file name. The new mappings are stored in the array $this->file. The files are not loaded yet, but only when needed. USAGE: setFile(array $filelist = (string $varname => string $filename)) or USAGE: setFile(string $varname, string $filename)
Tags:
Parameters:
method setRoot [line 168]
Checks that $root is a valid directory and if so sets this directory as the base directory from which templates are loaded by storing the value in $this->root.
Checks that $root is a valid directory and if so sets this directory as the base directory from which templates are loaded by storing the value in $this->root. Relative filenames are prepended with the path in $this->root.
Tags:
Parameters:
method setUnknowns [line 214]
void setUnknowns(
[string
$unknowns = 'remove'])
|
|
Sets the policy for dealing with unresolved variable names.
Sets the policy for dealing with unresolved variable names.
Tags:
Parameters:
method setVar [line 353]
bool setVar(
mixed
$varname, [mixed
$value = ''], [bool
$append = false])
|
|
Sets the value of a variable.
Sets the value of a variable. It may be called with either a varname and a value as two strings or an an associative array with the key being the varname and the value being the new variable value. The public function inserts the new value of the variable into the $varkeys and $varvals hashes. It is not necessary for a variable to exist in these hashes before calling this public function. An optional third parameter allows the value for each varname to be appended to the existing variable instead of replacing it. The default is to replace. This feature was introduced after the 7.2d release. USAGE: setVar(string $varname, [string $value = ''], [boolean $append = false]) or USAGE: setVar(array $varname = (string $varname => string $value), [mixed $dummy_var], [boolean $append = false])
Tags:
Parameters:
method startTimer [line 187]
Start the time to measure something
Start the time to measure something
Tags:
method subst [line 451]
mixed subst(
mixed
$varname)
|
|
Fills in all the variables contained within the variable named $varname. original value of the variable varname is not changed. is not 'finished'.
Fills in all the variables contained within the variable named $varname. The resulting value is returned as the public function result and the original value of the variable varname is not changed. The resulting string is not 'finished'. RETURNS: the value of the variable $varname with all variables substituted or FALSE if halted USAGE: subst(string $varname)
Tags:
Parameters:
method unsetVar [line 409]
void unsetVar(
mixed
$varname)
|
|
Unsets a variable completely.
Unsets a variable completely. It may be called with either a varname as a string or an array with the values being the varnames to be cleared. The public function removes the variable from the $varkeys and $varvals hashes. It is not necessary for a variable to exist in these hashes before calling this public function. USAGE: unsetVar(string $varname) or USAGE: unsetVar(array $varname = (string $varname))
Tags:
Parameters:
method varname [line 766]
string varname(
string
$varname)
|
|
Will construct a regexp for a given variable name with any special chars quoted.
Will construct a regexp for a given variable name with any special chars quoted.
Tags:
Parameters:
method __clone [line 142]
Singleton pattern implementation makes 'clone' unavailable
Singleton pattern implementation makes 'clone' unavailable
Tags: