笔记--ThinkPHP的URL模式
2016-08-23 12:56
239 查看
<?php // 本类由系统自动生成,仅供测试用途 class IndexAction extends Action { public function index(){ //echo 'hello, world!'; //echo C('URL_MODEL'); //U方法(1.模块名,2数组array("id"=>1),3.后缀名“html shtml”,4.是否跳转(true/false)5.localhost) echo U('Index/user',array('id'=>1),'html',false,'localhost'); } public function user(){ echo 'id is:'.$_GET['id'].'<br/>'; echo '这里是INDEX 模块的user方法'; } /* URL_MODEL return array( //'配置项'=>'配置值' 'name'=>'Tim', 'URL_MODEL'=>0, ); 1.默认模式 1 (pathinfo 模式 1) http://localhost/test313/index.php/Index/user/id/1.html 2.普通模式 0 http://localhost/test313/index.php?m=Index&a=user&id=1 3.重写模式 2 http://localhost/test313/Index/user/id/1.html 4.兼容模式 3 (不知道web服务器时候使用兼容模式可以运行起来) http://localhost/test313/index.php?s=/Index/user/id/1.html */ }
1.注意U方法的用法
2.注意URL_MODEL的设置。
3.注意各种方法的区别。
相关文章推荐
- thinkphp学习笔记6—url模式
- ThinkPHP 学习笔记 2.MVC模式和URL访问
- ThinkPHP 学习笔记(六) URL模式
- Thinkphp学习笔记1-URL模式
- thinkphp学习笔记6—url模式
- thinkphp学习笔记6—url模式
- URL模式-thinkphp
- ThinkPHP教程--14--URL模式
- 浅析ThinkPHP中的pathinfo模式和URL重写
- ThinkPHP中pathinfo模式与URL重写
- ThinkPHP URL访问模式
- thinkphp3.2 URL模式 用于自学
- ThinkPHP 四种URL模式
- Thinkphp分组模式下URL
- thinkPHP url模式与例子
- thinkPHP的URL路径模式问题
- JSP&&SERVLET学习笔记(三):URL模式设置
- ThinkPHP的四种URL模式
- ThinkPHP笔记——URL结构与模块分组
- ThinkPHP的URL模式