承接 weew/router-configurator 相关项目开发

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

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

weew/router-configurator

Composer 安装命令:

composer require weew/router-configurator

包简介

Makes weew/router configurable trough config files.

README 文档

README

Build Status Code Quality Test Coverage Version Licence

Table of contents

Installation

composer require weew/router-configurator

Introduction

This package makes the weew/router configurable trough config files or arrays. It is recommended to use the weew/config package for the loading of config files.

Usage

In this example I'll be using a configuration written in yaml:

# same as $router->addFilter('auth', [AuthFilter::class, 'filter');
filters:
    - name: auth
      filter: [Foo\Bar\AuthFilter, filter]

# same as $router->addResolver('user', [UserResolver::class, 'resolve');
resolvers:
    - name: user
      resolver: [Foo\Bar\UserResolver, resolve]

# same as $router->restrictProtocol(['http', 'https'])
protocol: [http, https]
# same as $router->restrictTLD(['com', 'net'])
tld: [com, net]
# same as $router->restrictDomain(['foo', 'bar'])
domain: [foo, bar]
# same as $router->restrictSubdomain(['foo', 'bar'])
subdomain: [foo, bar]
# same as $router->restrictHost(['foo.com'])
host: foo.com

# same as $router->group()
groups:
    # name is for readability only
    - name: public
      # same as $router->setController(HomeController::class)
      controller: HomeController
      routes:
        # same as $router->get('/', 'homeAction')
        - method: GET
          path: /
          action: homeAction
        # same as $router->route(['GET', 'POST'], 'contactAction')
        - method: [GET, POST]
          path: contact
          action: contactAction

    - name: api
      # same as $router->enableFilter('auth')
      filter: auth
      # same as $router->addPrefix('api/v1')
      prefix: api/v1

      groups:
       - name: users
         controller: Foo\Bar\UserController
         prefix: /users
         routes:
           - route: GET /
             action: list
           - route: POST /
             action: create
           - rotue: GET {user}
             action: show
           - route: PUT PATCH {user} update

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固