2017 © Pedro Peláez
 

library route-for-zanphp

route for zanphp

image

cjeruen/route-for-zanphp

route for zanphp

  • Thursday, November 2, 2017
  • by chenhui
  • Repository
  • 0 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

route for zanphp

功能说明

~ 在 zanphp 中 使用 FastRoute 路由, (*1)

~ 兼容 zanphp 默认 路由, (*2)

使用说明

1. 安装

composer require cjeruen/route-for-zanphp:dev-master, (*3)

2. 配置

2.1 启动加载

init/WorkerStart/.config.php, (*4)

或者, (*5)

init/ServerStart/.config.php, (*6)

return [
    // other initialize
    \Com\JeRuen\Zan\Routing\FastRoute\InitializeRouter::class,
];

2.2 配置路由类型

resource/config/share/route.php, (*7)

return [
    'default_route' => '/index',
    'default_controller' => 'index',
    'default_action' => 'index',
    'default_format' => 'html',

    'router_class' => 'Com\JeRuen\Zan\Routing\FastRoute\Router',
    'router_path' => 'src/routing.php',

    // compatible use zan router if not found. default false
    // 是否开启兼容zan路由(未匹配则找zan默认路由匹配)
    'router_compatible' => true,

];

2.3 定义路由规则


<?php use Com\JeRuen\Zan\Routing\FastRoute\R as Route; Route::get('/a', 'index/index/index'); Route::addRoute('POST', '/a', 'index/index/index');

相关连接

Zan* QQ交流群

  • 115728122

The Versions

02/11 2017

dev-master

9999999-dev

route for zanphp

  Sources   Download

MIT

The Requires

 

by Hui Chen

fastroute zanphp