2017 © Pedro Peláez
 

yii2-extension yii2-routes-collector

Routes collector for the Yii framework 2.0

image

cetver/yii2-routes-collector

Routes collector for the Yii framework 2.0

  • Monday, July 10, 2017
  • by cetver
  • Repository
  • 2 Watchers
  • 4 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Routes collector

Build Status Coverage Status, (*1)

Provides tools for collecting, saving and manipulating routes of web applications., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

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

or add, (*5)

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

to the require section of your composer.json file., (*6)

Configuring

Run the migration command, (*7)

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

Update the console application configuration file, (*8)

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

Usage

Create web-applications configuration file in the following format:, (*9)

<?php

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

Run the collect command, (*10)

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

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

./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, (*12)

Now you can set aliases/translations by editing the files: - @app/messages/en-US/routes.php - @app/messages/ru-RU/routes.php, (*13)

Tests

Run the following command, (*14)

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", (*15)

Change DB configuration here or run the following command, (*16)

export DB=sqlite

Run the following commands, (*17)

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

Examples

After running the tests, open the links - http://basic.cetver-yii2-routes-collector/examples/default/tree - http://backend.cetver-yii2-routes-collector/examples/default/tree, (*18)

If you follow the instructions correctly, you should see the pages as in the screenshots below - Basic app - Tree - Ordered tree - Aliases(i18n) - Real life example - Advanced apps - Tree - Ordered tree - Aliases(i18n) - Real life example, (*19)

The Versions

10/07 2017

dev-master

9999999-dev

Routes collector for the Yii framework 2.0

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexandr Cetvertacov

parser extension yii2 picker collector routes accumulator

10/07 2017

1.0.1

1.0.1.0

Routes collector for the Yii framework 2.0

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexandr Cetvertacov

parser extension yii2 picker collector routes accumulator

10/07 2017

1.0.0

1.0.0.0

Routes collector for the Yii framework 2.0

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexandr Cetvertacov

parser extension yii2 picker collector routes accumulator