Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.