skypaladin 发表于 2017-12-30 18:39:17

[PHP][thinkphp5] 学习二:路由、配置调用、常量定义调用

return [  //简单的路由配置
//推荐商品接口路由  
'product/getRecommendProduct' => 'gogogo/product/getRecommendProduct' ,
  //这是一个简单路由配置!我的域名配置到public目录,然后这样配置直接访问:域名+product/getRecommendProduct,这样访问就OK!不用在输入模块名!
  'product/getRecommendProduct' => ['gogogo/product/getRecommendProduct' ,['method' => 'post|put']] //这是详细一点的配置,
  //别名配置访问:域名+product/getRecommendProduct
  '__alias__' => [
  'product'=>'gogogo/product',
  ],
  ];
页: [1]
查看完整版本: [PHP][thinkphp5] 学习二:路由、配置调用、常量定义调用