naoki-tsuchiya/yii-route-list

0.1.2 2022-10-15 09:12 UTC

This package is auto-updated.

Last update: 2024-10-17 09:09:58 UTC


README

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);
}