From c2bf241a1a3a7ae607a3792087bbc5b4cf9f12f2 Mon Sep 17 00:00:00 2001 From: shoully <shoully@msn.com> Date: Sat, 20 Dec 2014 06:53:30 -0800 Subject: [PATCH] Created 17 Framework Instance (markdown) --- 17-Framework-Instance.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 17-Framework-Instance.md diff --git a/17-Framework-Instance.md b/17-Framework-Instance.md new file mode 100644 index 0000000..c314c81 --- /dev/null +++ b/17-Framework-Instance.md @@ -0,0 +1,15 @@ +Instead of running Flight as a global static class, you can optionally run it as an object instance. + + 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