2017 © Pedro Peláez
 

library router

image

level-2/router

  • Monday, February 13, 2017
  • by TomBZombie
  • Repository
  • 3 Watchers
  • 3 Stars
  • 34 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 26 % Grown

The README.md

Router

Router for the level 2 framework. This is an extensible router, the router does not provide any routing rules and needs to be extended with rules that use the Level2\Router\Rule interface., (*1)

Usage

Create an instance of the router and load any rules into it, (*2)


//Create an instance of a class that implements \Level2\Router\Rule $rule = new Rule; $router = new \Level2\Router\Router; $router->addRule($rule); $url = $_SERVER['REQUEST_URI'] $route = $router->find(explode('/', $url))

The router will return a Route object that has methods for returning the matched model, view and controller. It is up to the loaded rule to create this instance., (*3)

The Versions

13/02 2017

dev-master

9999999-dev

  Sources   Download