cetver/yii2-routes-collector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cetver/yii2-routes-collector

Composer 安装命令:

composer require cetver/yii2-routes-collector

包简介

Routes collector for the Yii framework 2.0

README 文档

README

Build Status Coverage Status

Provides tools for collecting, saving and manipulating routes of web applications.

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist cetver/yii2-routes-collector

or add

"cetver/yii2-routes-collector": "^1.0"

to the require section of your composer.json file.

Configuring

Run the migration command

./yii migrate --migrationPath=@cetver/RoutesCollector/migrations

Update the console application configuration file

'controllerMap' => [
    'routes' => 'cetver\RoutesCollector\commands\RoutesController',
],

Usage

Create web-applications configuration file in the following format:

<?php

return [
    [], // the configuration of the first web-app
    [], // the configuration of the second web-app
];

Run the collect command

./yii routes/collect <path-to-config-file>

If you need to display routes to the user, run the "routes/extract-message" command

./yii routes/extract-messages '{"messagePath":"@app/messages","languages":["en-US","ru-RU"]}' routes

The "routes/extract-message" command arguments:

  • The first argument is the "message/extract" command options in JSON format
  • The second argument is the first argument of the translator function

Now you can set aliases/translations by editing the files:

  • @app/messages/en-US/routes.php
  • @app/messages/ru-RU/routes.php

Tests

Run the following command

composer create-project --prefer-source cetver/yii2-routes-collector

Create virtual hosts (nginx example):

  • basic.cetver-yii2-routes-collector points to "tests/_data/apps/basic/web"
  • frontend.cetver-yii2-routes-collector points to "tests/_data/apps/advanced/backend/web"
  • backend.cetver-yii2-routes-collector points to "tests/_data/apps/advanced/frontend/web"

Change DB configuration here or run the following command

export DB=sqlite

Run the following commands

cd yii2-routes-collector
vendor/bin/codecept run unit,functional

Examples

After running the tests, open the links

If you follow the instructions correctly, you should see the pages as in the screenshots below

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固