skymvc官方教学课程:第二课、skymvc控制器使用hello.ctrl.php
视频:
-
控制器
hello.ctrl.php control规范
smarty->display("hello/index.html"); } /**列表Action***/ public function onList(){ $this->smarty->display("hello/list.html"); } /**详情Action***/ public function onShow(){ $this->smarty->display("hello/show.html"); } /**我的 Action***/ public function onMy(){ $this->smarty->display("hello/my.html"); } /**添加 Action***/ public function onAdd(){ $this->smarty->display("hello/add.html"); } /**保存 Action***/ public function onSave(){ } /**删除 Action***/ public function onDelete(){ } } ?>
2.url路由
配置 config
rewrite/pathinfo/正常模式
R('/index.php?m=hello&a=show&id=1')
{R('/index.php?m=hello&a=show&id=1')}
3.模板简介
{include }
{$data}
{foreach}
{if}
4.model简介
M("test")
select
selectRow
update
insert
delete