2017 © Pedro Peláez
 

library route

route component

image

sframe/route

route component

  • Thursday, December 4, 2014
  • by fredyang
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Router

Simple router. You can specify the route Or if not specified it'll take controller/action as default example: http://hello.com/controller/action?name=test, (*1)

Installation

composer require "sframe/router:dev-master"

Usage

$route = new SFrame\Router\Route(__DIR__ .'/Controllers');

// groups
$route->group(['prefix'=>'v1', 'before'=>function(){
    echo 'hello';
}], function($route){
    $route->get('test', 'TestController@tt');
    $route->post('hello', 'TestController@hello');
});

$route->put('test', 'TestController@pp');
$route->delete('test', 'TestController@dd');

try {
    $route->dispatch();
} catch (SFrame\Router\Exception\NotFound $e) {
    redirect('/404.html');
}

The Versions

04/12 2014

dev-master

9999999-dev

route component

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Fred Yang

router