PHP code example of qingbing / yii2-route
1. Go to this page and download the library: Download qingbing/yii2-route library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
qingbing / yii2-route example snippets
'controllerMap' => [
// 路由管理
'interface' => \YiiRoute\controllers\InterfaceController::class,
'interface-field' => \YiiRoute\controllers\InterfaceFieldController::class,
'route-log' => \YiiRoute\controllers\RouteLogController::class,
]
'bootstrap' => [
'bootRoute',
],
'components' => [
'bootRoute' => [
'class' => \YiiRoute\boots\RouteBootstrap::class,
'openRoute' => define_var('COM_BOOT_ROUTE_OPEN_ROUTE', true), // 开启路由记录
'acceptNewInterface' => define_var('COM_BOOT_ROUTE_ACCEPT_NEW_INTERFACE', true), // 记录新接口信息
'throwIfSystemNotExist' => define_var('COM_BOOT_ROUTE_THROW_IF_SYSTEM_NOT_EXIST', true), // 不存在的系统是否抛出异常终止
],
],
// bootRoute 组件(路由接口管理)
defined('COM_BOOT_ROUTE_OPEN_ROUTE') or define('COM_BOOT_ROUTE_OPEN_ROUTE', true); // 开启路由记录
defined('COM_BOOT_ROUTE_ACCEPT_NEW_INTERFACE') or define('COM_BOOT_ROUTE_ACCEPT_NEW_INTERFACE', true); // 记录新接口信息
defined('COM_BOOT_ROUTE_THROW_IF_SYSTEM_NOT_EXIST') or define('COM_BOOT_ROUTE_THROW_IF_SYSTEM_NOT_EXIST', true); // 不存在的系统是否抛出异常终止