From 48361221bbc4870d8f925fa892f38fe426cab680 Mon Sep 17 00:00:00 2001 From: shoully Date: Sat, 20 Dec 2014 06:15:55 -0800 Subject: [PATCH] Updated 05 Extending (markdown) --- 05 Extending.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/05 Extending.md b/05 Extending.md index 01ad9df..5252acd 100644 --- a/05 Extending.md +++ b/05 Extending.md @@ -37,9 +37,10 @@ The register method also allows you to pass along parameters to your class const If you pass in an additional callback parameter, it will be executed immediately after class construction. This allows you to perform any set up procedures for your new object. The callback function takes one parameter, an instance of the new object. // The callback will be passed the object that was constructed - Flight::register('db', 'Database', array('localhost', 'mydb', 'user', 'pass'), function($db){ - $db->connect(); - }); + Flight::register('db', 'Database', array('localhost', 'mydb', 'user', 'pass'), + function($db){ + $db->connect(); + }); By default, every time you load your class you will get a shared instance. To get a new instance of a class, simply pass in `false` as a parameter: