zoukankan      html  css  js  c++  java
  • thinkphp路由

    一、普通模式

    'url_route_on'  =>  false,

    二、混合模式

    'url_route_on'  =>  true,
    'url_route_must'=>  false,

    三、注册路由规则

    配置文件application/route.php进行注册:
    use thinkRoute;
    // 注册路由到index模块的News控制器的read操作
    Route::rule('new/:id','index/News/read');
    
    return [
    '__pattern__' => [
    'name' => 'w+',
    ],
    '[hello]' => [
    ':id' => ['index/hello', ['method' => 'get'], ['id' => 'd+']],
    ':name' => ['index/hello', ['method' => 'post']],
    ],
    
    ];
    

      四、URL生成

    Url::build('index/blog/read','id=5&name=thinkphp');
    Url::build('index/blog/read',['id'=>5,'name'=>'thinkphp']);
    

      



     

     

  • 相关阅读:
    洛朗级数
    泰勒级数
    中心极限定理
    置信区间公式
    简单随机样本的性质
    极大似然估计
    矩估计法
    摆摊70
    天天去哪吃
    天天和树
  • 原文地址:https://www.cnblogs.com/zgaspnet/p/8177580.html
Copyright © 2011-2022 走看看