From 000b1db3be856aa677f39e9661dd6163501c5204 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 15 Aug 2013 00:59:10 -0700 Subject: [PATCH] Added example for new Engine class. --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 8eef95f..f765c25 100644 --- a/README.md +++ b/README.md @@ -708,3 +708,24 @@ Flight::json($data) // Sends a JSON response. ``` Any custom methods added with `map` and `register` can also be filtered. + + +## Framework Instance + +Instead of running Flight as a global static class, you can optionally run it as an object instance. + +```php +require 'flight/autoload.php'; + +use flight\Engine; + +$app = new Engine(); + +$app->route('/', function(){ + echo 'hello world!'; +}); + +$app->start(); +``` + +All of the existing static methods are available as regular class methods. \ No newline at end of file