readme
来自「调用方法简单,支持if else include之类的标签, 可以包含扩展函数」· 代码 · 共 37 行
TXT
37 行
[Lightemplate]
Copyright (c) 2009 Troy
Class name: Lightemplate
Run environment on php5.*
Project owners and author Troy
Code license: GNU General Public License v3
Email list:
ooofox@msn.com
Created on:2009/5/1
You need setting an array, when instance this class.
$tempConf['templateDir'] setting template files path for template class
$tempConf['templateCompiledDir'] save compile file of template
$tempConf['templateExtDir'] template extension path
$tempConf['templateFileSuffix'] template suffix name, default is .tpl
The example for config:
$tempconf = array('templateDir'=>'./Tpl/',
'templateCompiledDir'=>'./Temp/Tpl_Compiled/',
'templateFileSuffix'=>'.tpl',
'templateExtDir'=>'./Common/smarttemplate_extensions/');
if your run environment is php5.3, because php5.3 support to call a method on instance variable.
so you should be instance an object, then use this instance variable to call a method of lightemplate.
The example for running an instance:
<?php
$t = new Lightemplate($tempconf);
$t->setFile('index');
$t->assign('test','hello world');
$t->output();
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?