PHP 클래스 Horde_Template, horde
Horde_Template provides a basic template engine with tags, loops,
and if conditions. However, it is also a simple interface with
several essential functions: set(), fetch(), and
parse(). Subclasses or decorators can implement (or delegate) these
three methods, plus the options api, and easily implement other
template engines (PHP code, XSLT, etc.) without requiring usage
changes.
Compilation code adapted from code written by Bruno Pedro
.
Copyright 2002-2016 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
파일 보기
프로젝트 열기: horde/horde
1 사용 예제들
보호된 프로퍼티들
공개 메소드들
보호된 메소드들
메소드 상세
public __construct ( array $params = [] ) |
$params |
array |
The following configuration options:
'basepath' - (string) The directory where templates are read from.
'cacheob' - (Horde_Cache) A caching object used to cache the output.
'logger' - (Horde_Log_Logger) A logger object.
|
protected _doSearch ( $tag, $key, $noclose = false ) |
_generatePHPVar()
보호된 메소드
Output the correct PHP variable string for use in template space.
Parses all variables/tags in the template.
Parses the given array for any loops or other uses of the array.
Fetches a template from the specified file and return the parsed
contents.
Returns the value of a tag or loop.
Returns an option's value.
Parses all variables/tags in the template.
Sets a tag, loop, or if variable.
public set ( string | array $tag, mixed $var ) |
$tag |
string | array |
Either the tag name or a hash with tag names
as keys and tag values as values. |
$var |
mixed |
The value to replace the tag with. |
Currently available options are:
'debug' - Output debugging information to screen
'forcecompile' - Force a compilation on every page load
'gettext' - Activate gettext detection
Set the template contents to a string.
프로퍼티 상세
protected array $_arrays |
리턴 |
array |
|
Directory that templates should be read from.
protected string $_basepath |
리턴 |
string |
|
The Horde_Cache object to use.
protected Horde_Cache $_cache |
리턴 |
Horde_Cache |
|
$_foreachMap 보호되어 있는 프로퍼티
Foreach variable mappings.
protected array $_foreachMap |
리턴 |
array |
|
$_foreachVar 보호되어 있는 프로퍼티
Foreach variable incrementor.
protected int $_foreachVar |
리턴 |
integer |
|
protected Horde_Log_Logger $_logger |
리턴 |
Horde_Log_Logger |
|
protected array $_options |
리턴 |
array |
|
protected array $_pregcache |
리턴 |
array |
|
protected array $_scalars |
리턴 |
array |
|
protected string $_template |
리턴 |
string |
|
$_templateFile 보호되어 있는 프로퍼티
protected string $_templateFile |
리턴 |
string |
|