2017 © Pedro Peláez
 

library iroute

php简单路由

image

farmer/iroute

php简单路由

  • Friday, August 11, 2017
  • by bejea
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 33 % Grown

The README.md

Iroute

Iroute::get('/', function() {
  echo 'Hello world!';
});

Iroute::dispatch();

Iroute also supports lambda URIs, such as:, (*1)

Iroute::get('/(:any)', function($slug) {
  echo 'The slug is: ' . $slug;
});

Iroute::dispatch();

You can also make requests for HTTP methods in Macaw, so you could also do:, (*2)

Iroute::get('/', function() {
  echo 'I <3 GET commands!';
});

Iroute::post('/', function() {
  echo 'I <3 POST commands!';
});

Iroute::dispatch();

Lastly, if there is no route defined for a certain location, you can make Iroute run a custom callback, like:, (*3)

Iroute::error(function() {
  echo '404 :: Not Found';
});

The Versions

11/08 2017

dev-master

9999999-dev

php简单路由

  Sources   Download

MIT

The Requires

  • php >=5.3.3