Thinkphp debug为true时页面能正常打开,关闭debug后,页面错误。


设置了thinkphp的路由功能,在全局配置文件common/conf/config.php下设置了

'URL_ROUTER_ON'   => true, 
'URL_ROUTE_RULES'=>array(
    'news/:year/:month/:day' => array('Admin/Account/news', 'status=1'),
    'news/:id'               => 'Admin/Account/index',
    'blog/:year\d|md5/[:month\d]'=>'Admin/Account/index',
    '/^article\/(\d{0,4})\/(\d{0,2})$/'=>'Admin/Account/article?year=:1&month=:2',
    'closeure/:s'=>function($s){echo 'php closeure'.$s;print_r($_GET);},
    '/^rule\/(\d{0,4})\/(\d{0,2})$/'=>function ($year,$month){
        echo $year.$month;
     },
    'read/:ids'=>array('Admin/Account/index','callback=myJsonp'),
    'model'=>array('Admin/Account/model'),
 ),

在debug为true的情况下,能正常打开,访问地址是:index.php/model

但是关闭debug后,出现页面错误。

 

后面将上面一段剪切到模块目录Admin/confi/config.php里面,能正常访问了。

 应该是公共配置文件会被模块配置文件覆盖的原因。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM