本文整理匯總了PHP中Zend\View\Helper\Placeholder\Registry::getRegistry方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registry::getRegistry方法的具體用法?PHP Registry::getRegistry怎麽用?PHP Registry::getRegistry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\View\Helper\Placeholder\Registry
的用法示例。
在下文中一共展示了Registry::getRegistry方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testNamespaceRegisteredInPlaceholderRegistryAfterInstantiation
public function testNamespaceRegisteredInPlaceholderRegistryAfterInstantiation()
{
$registry = PlaceholderRegistry::getRegistry();
if ($registry->containerExists('Zend_View_Helper_HeadLink')) {
$registry->deleteContainer('Zend_View_Helper_HeadLink');
}
$this->assertFalse($registry->containerExists('Zend_View_Helper_HeadLink'));
$helper = new Helper\HeadLink();
$this->assertTrue($registry->containerExists('Zend_View_Helper_HeadLink'));
}
示例2: __construct
/**
* Constructor
*
* Retrieve container registry from Zend_Registry, or create new one and register it.
*
* @return void
*/
public function __construct()
{
$this->_registry = Placeholder\Registry::getRegistry();
}
示例3: _initVarContainer
/**
* Initialize placeholder container for layout vars
*
* @return \Zend\View\Helper\Placeholder\Container
*/
protected function _initVarContainer()
{
if (null === $this->_container) {
$this->_container = \Zend\View\Helper\Placeholder\Registry::getRegistry()->getContainer(__CLASS__);
}
return $this->_container;
}
示例4: testGetRegistryRegistersWithGlobalRegistry
public function testGetRegistryRegistersWithGlobalRegistry()
{
$this->assertFalse(\Zend\Registry::isRegistered(Registry::REGISTRY_KEY));
$registry = Registry::getRegistry();
$this->assertTrue(\Zend\Registry::isRegistered(Registry::REGISTRY_KEY));
$registered = \Zend\Registry::get(Registry::REGISTRY_KEY);
$this->assertSame($registry, $registered);
}
示例5: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
$this->setRegistry(Registry::getRegistry());
$this->setContainer($this->getRegistry()->getContainer($this->_regKey));
}
示例6: testGetRegistrySubsequentTimesReturnsSameInstance
public function testGetRegistrySubsequentTimesReturnsSameInstance()
{
$registry1 = Registry::getRegistry();
$registry2 = Registry::getRegistry();
$this->assertSame($registry1, $registry2);
}
示例7: initVarContainer
/**
* Initialize placeholder container for layout vars
*
* @return \Zend\View\Helper\Placeholder\Container
*/
protected function initVarContainer()
{
if (null === $this->container) {
$this->container = PlaceholderRegistry::getRegistry()->getContainer(get_called_class());
}
return $this->container;
}