Created
December 8, 2016 12:26
-
-
Save gayanhewa/583c3237627b6908b3883b54220e91c5 to your computer and use it in GitHub Desktop.
Adding Routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using a closure | |
$router->add('GET', '/', function() { | |
echo "Hello World"; | |
}); | |
// Using class method mapping | |
$route->add('GET', '/new/route', ClassName::class, 'method'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment