控制器-方法 来获取数据,输出视图;控制器-方法 模式登场了!/_ctrls/下;
如:/views/comm/_ctrls/, /views/adm/_ctrls/;infoCtrl.php, newsCtrl.php;mapAct, dutyAct ... 对应 info-map, info-duty 路由;namespace imcat\comm;, namespace imcat\adm;文件:{views}/demo/_ctrls/modcCtrl.php
查看代码
modc-m2kid1,方法m2kid1Act,设置newtpl = 'mod2/kid1'; : 更改模板为{views}/demo/mod2/kid1.htm;modc-hi,方法hiAct,设置newtpl = 'modc/hello'; : 更改模板为{views}/demo/modc/hello.htm;modc-tplorg,方法tplorgAct,设置tplorg = 'modc/tplorg'; : 更改模板为{views}/demo/modc/tplorg.htm,切模板为纯htm或php代码,标签不会解析;modc-notpl,方法notplAct,设置tplnull = 1; : 设置不需要模板;当然,也可直接在方法里面die();空操作/_empty();系统在找不到路由对应的操作方法时,会定位到默认方法(_defAct)(如果有)来执行。modcCtrl 定义了一些方法;那么除上述之外,我任意输入其他类似modc-xxx的路由,想让它们统一通过一个方法执行;\_defAct方法;空控制器/EmptyController;当系统找不到请求的控制器名称的时候,系统会尝试定位默认控制器(_defCtrl)。