Skip to content

Instantly share code, notes, and snippets.

@jlebensold
Created October 16, 2011 17:31
Show Gist options
  • Save jlebensold/1291171 to your computer and use it in GitHub Desktop.
Save jlebensold/1291171 to your computer and use it in GitHub Desktop.
Zendcasts: SLIMming Out Your Controller
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
<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>
<?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