/Whitewashing_Controller_Helper_Container.php
Forked from beberlei/Whitewashing_Controller_Helper_Container.php
Created Jul 10, 2009
<?php | |
/** | |
* @package Whitewashing | |
* | |
*/ | |
class Whitewashing_Controller_Helper_Container extends Zend_Controller_Action_Helper_Abstract | |
{ | |
/** | |
* @var Yadif_Container | |
*/ | |
protected $_container = null; | |
public function init() | |
{ | |
$this->_container = $this->_actionController->getInvokeArg('bootstrap')->getContainer(); | |
} | |
/** | |
* @param string $resource | |
* @return object | |
*/ | |
public function direct($resource) | |
{ | |
$object = $this->_container->$resource; | |
if($object == null) { | |
throw new Exception( | |
"Unknown resource '".$resource."' accessed." | |
); | |
} | |
return $object; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment