Example #1
0
 /**
  * Placeholder helper
  *
  * @param  string $name
  * @return \Zend\View\Helper\Placeholder\Container\AbstractContainer
  */
 public function direct($name = null)
 {
     if ($name == null) {
         throw new \InvalidArgumentException('Placeholder: missing argument.  $name is required by placeholder($name)');
     }
     $name = (string) $name;
     return $this->_registry->getContainer($name);
 }
Example #2
0
 public function testSetContainerCreatesRegistersContainerInstance()
 {
     $foo = new Container(array('foo', 'bar'));
     $this->assertFalse($this->registry->containerExists('foo'));
     $this->registry->setContainer('foo', $foo);
     $container = $this->registry->getContainer('foo');
     $this->assertSame($foo, $container);
 }