Skip to content

NaokiTsuchiya/NaokiTsuchiya.YiiRouteList

Repository files navigation

codecov Scrutinizer Code Quality Continuous Integration Coding Standards Static Analysis

naoki-tsuchiya/yii-route-list

It gets a list of route from each of rules of UrlManager in Yii Framework 1.1.

Installation

composer require --dev naoki-tsuchiya/yii-route-list

Usage

<?php

use NaokiTsuchiya\YiiRouteList\YiiRouteList;

define('YII_ENABLE_EXCEPTION_HANDLER', false);
define('YII_ENABLE_ERROR_HANDLER', false);

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/yiisoft/yii/framework/yii.php';

// Your Yii application config
$config = dirname(__FILE__).'/protected/config/main.php';

$app = Yii::createWebApplication($config)

$routeList = (new YiiRouteList())($app);

foreach ($routeList as $route) {
    var_dump($route->rule);
    var_dump($route->controller);
    var_dump($route->action);
}