2017 © Pedro Peláez
 

library phalcon-router-adapter-config

image

iwai/phalcon-router-adapter-config

  • Wednesday, March 18, 2015
  • by iwai
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Phalcon\Mvc\Router\Config

Provides the ability to perform the Routing from configuration, (*1)

Install

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

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

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

The Versions

18/03 2015

dev-master

9999999-dev https://github.com/iwai/phalcon-router-adapter-config

  Sources   Download

MIT

The Requires

  • php >=5.3.6

 

The Development Requires

18/03 2015

1.0.0

1.0.0.0 https://github.com/iwai/phalcon-router-adapter-config

  Sources   Download

MIT

The Requires

  • php >=5.3.6

 

The Development Requires