Probably a dumb question but I'm trying to break free from CakePHP's bottlefeeding. I'm writing a basic framework for myself and I've got the registry concept down, but I can't figure out how to use objects in other objects. For example, I can load "database" and "template" just fine, and they function perfectly on their own, but I can't use database from inside template... Do I need to load the registry in every object? Seems to defeat the purpose if so. Thanks for your help.
There are 2 options, make the object global! or pass it to other objects for example $GLOBALS['db'] = new database(); // globaly setting it up or use it by passing it to other objects $tpl = new template(Database $db) Hope you get my point.