当前位置: 首页>>代码示例>>PHP>>正文


PHP Registry::getRegistry方法代码示例

本文整理汇总了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'));
 }
开发者ID:benivaldo,项目名称:zf2-na-pratica,代码行数:10,代码来源:HeadLinkTest.php

示例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();
 }
开发者ID:nevvermind,项目名称:zf2,代码行数:11,代码来源:Placeholder.php

示例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;
 }
开发者ID:hjr3,项目名称:zf2,代码行数:12,代码来源:Layout.php

示例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);
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:8,代码来源:RegistryTest.php

示例5: __construct

 /**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     $this->setRegistry(Registry::getRegistry());
     $this->setContainer($this->getRegistry()->getContainer($this->_regKey));
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:10,代码来源:Standalone.php

示例6: testGetRegistrySubsequentTimesReturnsSameInstance

 public function testGetRegistrySubsequentTimesReturnsSameInstance()
 {
     $registry1 = Registry::getRegistry();
     $registry2 = Registry::getRegistry();
     $this->assertSame($registry1, $registry2);
 }
开发者ID:navassouza,项目名称:zf2,代码行数:6,代码来源:RegistryTest.php

示例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;
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:12,代码来源:Layout.php


注:本文中的Zend\View\Helper\Placeholder\Registry::getRegistry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。