Skip to content

aloncn/iroute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iroute

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

Iroute::dispatch();

Iroute also supports lambda URIs, such as:

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:

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:

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

About

php简单路由

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published