开发流程
发布时间: 2014-04-04 14:44 浏览:10796
无php基础的参考:http://www.damicms.com/bbs/forum.php?mod=viewthread&tid=97#lastpost
(1)创建控制器lib\action\testaction.class.php 写控制方法并赋值(assign)模板变量:
class articleaction extends action
{
public function mytest()
{
$type = d('type'); //调用模型lib/model/typemodel.class.php
$list = $type->select();
$this->assign('type',$list);
$this->display(tmpl_path.'default/test.html'); //调用模板输出
}
}
(2)在模板中(tpl\default\test.html)调用大米cms标签显示数据.
(3)模板中 {:u(“test/mytest”)} 生成url 结果: index.php?m=test&a=mytest