Updated 05 Extending (markdown)

master
shoully 11 years ago
parent 010af05722
commit 48361221bb

@ -37,7 +37,8 @@ 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){
Flight::register('db', 'Database', array('localhost', 'mydb', 'user', 'pass'),
function($db){
$db->connect();
});

Loading…
Cancel
Save