定制 iwai/phalcon-router-adapter-config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iwai/phalcon-router-adapter-config

最新稳定版本:1.0.0

Composer 安装命令:

composer require iwai/phalcon-router-adapter-config

包简介

README 文档

README

Provides the ability to perform the Routing from configuration

Install

{
    "require": {
        "iwai/phalcon-mvc-router-config": "*"
    }
}

Recommended

Recommended the use of Phalcon\Config\Adapter\Yaml in incubator, of course, it is possible even otherwise.

Example configuration of yaml file.

# Example:
# user_view:
#   method:     [ GET, POST ]
#   url:        /user/view/{user_id}
#   controller: user
#   action:     view
#   namespace:  \App\FrontendController

# Route for UserController::indexAction mapped url for /user
user_index:
  method: GET
  url:        /user
  controller: user
  action:     index
# Same as in the example above, can be omitted `index` and `url`,`controller`,`action`
user:
  method: GET

# Route for UserController::viewAction mapped url for /user/view
user_view:
  method: GET

# Route for ShopController::viewAction, mapped url for /shop/view/1234
# can be define names to route parameters
# see: http://docs.phalconphp.com/en/latest/reference/routing.html#parameters-with-names
shop_view:
  method: GET
  url:    /shop/view/{shop_id}

shop_create:
  method: [ GET, POST ]
  url:    /shop/create
$di['router'] = function() {
    // Use the config router
    $router = new \Phalcon\Mvc\Router\Config();
    $router->build(
        new Phalcon\Config\Adapter\Yaml('path/route.yml')
    );
    return $router;
};

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-18