Download the PHP package xinnianq/yii2-routes without Composer

On this page you can find all versions of the php package xinnianq/yii2-routes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-routes

yii2-routes

获取yii2项目所有路由,方便权限控制

安装说明

php composer.phar require --prefer-dist xinnianq/yii2-routes

使用1(获取所有路由):


use xinnianq\yii2Routes\Routes;

$yiiRoutes = Routes::getAppRoutes();

var_dump($yiiRoutes);

使用2(获取单个module):


use xinnianq\yii2Routes\Routes;

$yiiRoutes = Routes::getAppRoutes('gii');

var_dump($yiiRoutes);

注意:

use Yii; use yii\web\Controller;

/**

  • 你好控制器
  • @package app\controllers
  • @author fengqiquan */ class NihaoController extends Controller {

    /**

    • 你好index方法
    • @return string */ public function actionIndex() { return $this->render('index'); }

}

返回结果:


array(2) {
  ["/nihao/"]=>
  array(2) {
    ["controllerDescription"]=>
    string(15) "你好控制器"
    ["route"]=>
    array(1) {
      ["/nihao/index"]=>
      array(2) {
        [0]=>
        string(12) "/nihao/index"
        [1]=>
        string(17) "你好index方法"
      }
    }
  }
  ["/site/"]=>
  array(2) {
    ["controllerDescription"]=>
    string(0) ""
    ["route"]=>
    array(5) {
      ["/site/index"]=>
      array(2) {
        [0]=>
        string(11) "/site/index"
        [1]=>
        string(18) "Displays homepage."
      }
      ["/site/login"]=>
      array(2) {
        [0]=>
        string(11) "/site/login"
        [1]=>
        string(13) "Login action."
      }
      ["/site/logout"]=>
      array(2) {
        [0]=>
        string(12) "/site/logout"
        [1]=>
        string(14) "Logout action."
      }
      ["/site/contact"]=>
      array(2) {
        [0]=>
        string(13) "/site/contact"
        [1]=>
        string(22) "Displays contact page."
      }
      ["/site/about"]=>
      array(2) {
        [0]=>
        string(11) "/site/about"
        [1]=>
        string(20) "Displays about page."
      }
    }
  }
}

All versions of yii2-routes with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xinnianq/yii2-routes contains the following files

Loading the files please wait ....