本文实例讲述了thinkphp中空模板与空模块的用法。分享给大家供大家参考。具体实现方法如下:
1. 空操作
function _empty($name){
$this-]show("$name 不存在 [a href='__APP__/Index/index']返回首页[/a]");
}
2. 空模块
class EmptyAction extends Action{
function index(){
$city=M('City');
$arr=$city-]select();
$this-]assign('list',$arr);
$name=MODULE_NAME;//获得当前地址栏的模块名
$this-]display("City:$name");//引用对应的模块
}
}
希望本文所述对大家的ThinkPHP框架程序设计有所帮助。
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn