// Include router class include('route.php'); // Add base route (startpage) Route::add('/',function(){ echo 'Welcome :-)'; }); // Simple test route that simulates static html file Route::add('/test.html',function(){ echo 'Hello from test.html'; }); // Post route example Route::add('/contact-form',function(){ echo '
'; },'get'); // Post route example Route::add('/contact-form',function(){ echo 'Hey! The form has been sent:
'; print_r($_POST); },'post'); // Accept only numbers as parameter. Other characters will result in a 404 error Route::add('/foo/([0-9]*)/bar',function($var1){ echo $var1.' is a great number!'; }); Route::run('/');