Created
October 16, 2011 17:31
-
-
Save jlebensold/1291171 to your computer and use it in GitHub Desktop.
Zendcasts: SLIMming Out Your Controller
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.php [QSA,L] |
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
<html> | |
<head> | |
<title> Hello <?= $name; ?> </title> | |
<style> | |
* | |
{ | |
margin: 0 0; | |
padding: 0 0; | |
font-family: helvetica, arial, sans-serif; | |
} | |
body { | |
background: #CCC; | |
} | |
#container | |
{ | |
padding: 20px; | |
margin: 0 auto; | |
width: 600px; | |
background: #FFF; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="container"> | |
Hello, <?= $name; ?> | |
</div> | |
</body> | |
</html> |
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 | |
require '../Slim/Slim.php'; | |
$app = new Slim(); | |
$app->get('/hello/:name', function($name) | |
{ | |
include 'hello.tpl.php'; | |
}); | |
$app->get('/', function() { | |
echo "slim home! "; | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment