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.
Run the migration command
./yii migrate --migrationPath=@cetver/RoutesCollector/migrations
Update the console application configuration file
'controllerMap' => [ 'routes' => 'cetver\RoutesCollector\commands\RoutesController', ],
Create web-applications configuration file in the following format:
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:
Now you can set aliases/translations by editing the files:
@app/messages/en-US/routes.php@app/messages/ru-RU/routes.phpRun the following command
composer create-project --prefer-source cetver/yii2-routes-collector
Create virtual hosts (nginx example):
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
After running the tests, open the links
If you follow the instructions correctly, you should see the pages as in the screenshots below
Basic app
Advanced apps
Be the first person to leave a comment
Please login to leave your comment.