thinkphp中空模板与空模块的用法实例_PHP

WBOY
Release: 2016-06-01 14:35:46
Original
1049 people have browsed it

本文实例讲述了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框架程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!