承接 mikbox74/yii2-autorouter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mikbox74/yii2-autorouter

Composer 安装命令:

composer require mikbox74/yii2-autorouter

包简介

This component allows modules to create rules for UrlManager by method

README 文档

README

This component allows modules to create rules for UrlManager by method.

Installing:

composer require mikbox74/yii2-autorouter

Step 1: add the component in bootstrap list of your application (main.php, main-local.php) like here:

return [
    // ...
     'bootstrap' => [
         [
             'class' => \mikbox74\Autorouter\AutorouterComponent::class,
         ],
         //...
     ],
];

Step 2: make your module class to implement \mikbox74\Autorouter\AutorouterInterface then add a method getUrlRules() and make it returning a rule array as if you configure the module's rules in main.php or main-local.php, like in the example:

 public static function getUrlRules()
 {
     return [
         [
             'class' => 'yii\rest\UrlRule',
             'controller' => [
                 'mymodule/controller',
             ],
         ],

         'GET  mymodule/controller/<id:\d+>'   => 'mymodule/controller/view',
         'POST mymodule/controller'            => 'mymodule/controller/create',
         'PUT mymodule/controller/<id:\d+>'    => 'mymodule/controller/update',
         'DELETE mymodule/controller/<id:\d+>' => 'mymodule/controller/delete',
     ];
 }

统计信息

  • 总下载量: 30
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固