i have a loader class and it's basically a registry except that it actually instantiates the class within it and keeps the library and it's label within. no big deal. i just added a little bit of functionality to it.
i have all the basica functionality in here. get a library, register a library and all that good stuff. the restry is a very large global in memory (i wanted to keep it smaller but what can i do now
Code: Select all
$registry = new BlackBarnRegistry();
$registry->loadDebug('debug.View');Code: Select all
$template = $load->get('View');
$template->set('Body', $BodyText);
$template->fetch('error.tpl');Code: Select all
public function set($object, $label)
{
if (isset($this->library[$label]))
{
$this->library[$label] = $object;
return true;
}
return false;
}Code: Select all
$registry->set($template, 'View');well, i have to update what is within that class don't i? and if i do can i do this from the registry class or do i have to add that functionality to each and every class that i have?
also, second question. this class is a registry but it's also an autoloader class. to make it simpler for me. what should i name it? as it stands it's Loader. thoughts on that would be nice