快速搭建PC网站+手机APP+微信平台,自适应安卓、苹果IOS等.

手机CMS应用领跑者,10万用户见证大米CMS商业级应用!马上下载

开发流程

发布时间: 2014-04-04 14:44 浏览:10853

无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