$rt = new Rt();
$rt
->get('/(.*)/i')
->dispatch(function() {
return '<h1>404</h1>';
})
->get('/^\/($|index$|index.(html|php|asp|jsp|htm)$)/i')
->dispatch(function() {
return '<h1>It works!</h1>';
})
->get('/^\/string$/i')
->dispatch(function() {
return array('json_string' => str_shuffle('hello world'));
})
->json()
->get('/^\/random$/i')
->dispatch(function() {
return array('rand' => rand(0, 1000));
})
->json()
->post('/^\/test$/i')
->dispatch(function($msg='default', $test='not default') {
return 'this is reply for POST request with params '
. $msg
. ' and also '
. $test;
})
->get('/^\/xslt$/i')
->dispatch(function($data='test') {
return array('input' => $data);
})
->xml()
->xslt(array('stylesheet' => 'sample.xslt'))
->format_by_request()
->run();
-
Notifications
You must be signed in to change notification settings - Fork 0
Tiny sinatra- and bottle-like (ruby and python respectively) bare PHP5 microframework created for speeding-up and simplification of work with daily routines. Features: easy routing via regex, urls are permanent, controllers and views implements decorator pattern, possible to use framework with both , apache2ctl (web) and cli (command-line) SAPI.
nmtitov/routiny
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Latest commit | ||||
Repository files navigation
About
Tiny sinatra- and bottle-like (ruby and python respectively) bare PHP5 microframework created for speeding-up and simplification of work with daily routines. Features: easy routing via regex, urls are permanent, controllers and views implements decorator pattern, possible to use framework with both , apache2ctl (web) and cli (command-line) SAPI.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published