XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TemplateHandler Class Reference

Public Member Functions

 __construct ()
 
 compile ($tpl_path, $tpl_filename, $tpl_file= '')
 
 compileDirect ($tpl_path, $tpl_filename)
 
 _getRelativeDir ($path)
 
 _replaceVar ($php)
 
 isAutoescape ()
 
 setAutoescape ($val=true)
 

Static Public Member Functions

static & getInstance ()
 

Protected Member Functions

 init ($tpl_path, $tpl_filename, $tpl_file= '')
 
 parse ($buff=null)
 

Detailed Description

Author
NAVER (devel.nosp@m.oper.nosp@m.s@xpr.nosp@m.esse.nosp@m.ngine.nosp@m..com) template compiler
Version
0.1
Remarks
It compiles template file by using regular expression into php code, and XE caches compiled code for further uses

Definition at line 12 of file TemplateHandler.class.php.

Constructor & Destructor Documentation

TemplateHandler::__construct ( )

constructor

Returns
void

Definition at line 32 of file TemplateHandler.class.php.

Member Function Documentation

TemplateHandler::_getRelativeDir (   $path)

change relative path

Parameters
string$path
Returns
string

Definition at line 1007 of file TemplateHandler.class.php.

TemplateHandler::_replaceVar (   $php)

Replace PHP variables of $ character

Parameters
string$php
Returns
string $__Context->varname

Definition at line 1056 of file TemplateHandler.class.php.

TemplateHandler::compile (   $tpl_path,
  $tpl_filename,
  $tpl_file = '' 
)

compiles specified tpl file and execution result in Context into resultant content

Parameters
string$tpl_pathpath of the directory containing target template file
string$tpl_filenametarget template file's name
string$tpl_fileif specified use it as template file's full path
Returns
string Returns compiled result in case of success, NULL otherwise

Definition at line 139 of file TemplateHandler.class.php.

TemplateHandler::compileDirect (   $tpl_path,
  $tpl_filename 
)

compile specified file and immediately return

Parameters
string$tpl_pathpath of the directory containing target template file
string$tpl_filenametarget template file's name
Returns
string Returns compiled content in case of success or NULL in case of failure

Definition at line 219 of file TemplateHandler.class.php.

static& TemplateHandler::getInstance ( )
static

returns TemplateHandler's singleton object

Returns
TemplateHandler instance

Definition at line 60 of file TemplateHandler.class.php.

TemplateHandler::init (   $tpl_path,
  $tpl_filename,
  $tpl_file = '' 
)
protected

set variables for template compile

Parameters
string$tpl_path
string$tpl_filename
string$tpl_file
Returns
void

Definition at line 91 of file TemplateHandler.class.php.

TemplateHandler::isAutoescape ( )

Definition at line 1065 of file TemplateHandler.class.php.

TemplateHandler::parse (   $buff = null)
protected

parse syntax.

Parameters
string$bufftemplate file
Returns
string compiled result in case of success or NULL in case of error

Definition at line 238 of file TemplateHandler.class.php.

TemplateHandler::setAutoescape (   $val = true)

Definition at line 1086 of file TemplateHandler.class.php.


The documentation for this class was generated from the following file: