Created
March 16, 2012 07:14
-
-
Save gsdevme/2048978 to your computer and use it in GitHub Desktop.
Quick app() function for PHP 5.2 with slim
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'; | |
function app() | |
{ | |
static $app; | |
if(gettype($app) != 'object'){ | |
$app = new Slim(); | |
} | |
return $app; | |
} | |
function test() | |
{ | |
app()->response()->body('hello world'); | |
} | |
app()->get('/', 'test'); | |
app()->run(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment