Skip to content

Instantly share code, notes, and snippets.

@jlebensold jlebensold/.htaccess
Created Oct 16, 2011

Embed
What would you like to do?
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
You can’t perform that action at this time.