/* Static get */
function staticGet($k,$v=NULL) {
return DB_DataObject::staticGet('DataObjects_User',$k,$v);
}
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
?>
它还会为user表模式生成example.ini配置文件:
[user]
user_Id = 129
first_Name = 130
last_Name = 130
email = 130
[user__keys]
user_Id = N
Smarty files
It's time to create several files for Smarty:
Smarty文件
现在是创建几个Smarty文件的时候了:
include.php
1 <?
2 require('Smarty.class.php');
3 $smarty = new Smarty;
4 $smarty->template_dir = 'templates/';
5 $smarty->compile_dir = 'templates_c/';
6 $smarty->config_dir = 'configs/';
7 $smarty->cache_dir = 'cache/';
?>
此脚本实例化了一个新Smarty对象.设置Smarty属性.
index.php
1 <?
2 require("include.php");
3 $smarty->assign('TITLE','ACCESS MySQL DATABASE IN THREE TIERS WITH PHP');
4 $smarty->assign('HEADER','WHAT WISH DO ?');
5 $smarty->display('index.tpl');
?>
给Smarty模板分配变量.
insert.php
1 <?
2 require("include.php");
3 $smarty->assign('TITLE','INSERT DATA');
4 $smarty->assign('HEADER','Insert Data');
5 $smarty
| 对此文章发表了评论 |
