开发流程
发布时间: 2014-04-04 14:44 浏览:10870
无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标签显示数据.
<volist name="type" id="vo">{$vo.typename}</volist>
(3)模板中 {:U(“Test/mytest”)} 生成url 结果: index.php?m=Test&a=mytest