Created
April 5, 2012 09:08
-
-
Save dustinlakin/2309375 to your computer and use it in GitHub Desktop.
Routes and Controllers
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
<?php | |
$app = new Slim(); | |
//routes here | |
$app->get('/', 'home'); | |
$app->get('/hi/:first(/)', 'hi'); | |
$app->get('/test(/)', 'test'); | |
$app->run(); | |
//controllers here! | |
function home(){ | |
global $config; | |
$title = "Hello World"; | |
require $config->viewsPath . "header.php"; | |
require $config->viewsPath . "home.php"; | |
require $config->viewsPath . "footer.php"; | |
} | |
function hi($first){ | |
echo "hi $first"; | |
} | |
function test(){ | |
phpinfo(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment