當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Placeholder\Registry類代碼示例

本文整理匯總了PHP中Zend\View\Helper\Placeholder\Registry的典型用法代碼示例。如果您正苦於以下問題:PHP Registry類的具體用法?PHP Registry怎麽用?PHP Registry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Registry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     // Necessary to ensure placeholders do not persist between individual tests
     PlaceholderRegistry::unsetRegistry();
     $this->renderer = new PhpRenderer();
     $this->strategy = new PhpRendererStrategy($this->renderer);
     $this->event = new ViewEvent();
     $this->response = new HttpResponse();
 }
開發者ID:razvansividra,項目名稱:pnlzf2-1,代碼行數:9,代碼來源:PhpRendererStrategyTest.php

示例2: setUp

 public function setUp()
 {
     \Zend\View\Helper\Placeholder\Registry::unsetRegistry();
     $this->basePath = __DIR__ . '/_files/modules';
     $renderer = new \Zend\View\Renderer\PhpRenderer();
     $renderer->plugin('basePath')->setBasePath($this->basePath);
     $this->helper = new CtrlJsLoader();
     $this->helper->setView($renderer);
 }
開發者ID:siad007,項目名稱:ctrllib,代碼行數:9,代碼來源:CtrlJsLoaderTest.php

示例3: 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

示例4: _after

 public function _after(\Codeception\TestCase $test)
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     // reset singleton
     StaticEventManager::resetInstance();
     Placeholder\Registry::unsetRegistry();
     $this->queries = 0;
     $this->time = 0;
 }
開發者ID:NaszvadiG,項目名稱:ImageCMS,代碼行數:12,代碼來源:ZF2.php

示例5: _after

 public function _after(\Codeception\TestCase $test)
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     // reset singleton
     StaticEventManager::resetInstance();
     // Reset singleton placeholder if version < 2.2.0, no longer required in 2.2.0+
     if (Version::compareVersion('2.2.0') >= 0) {
         Placeholder\Registry::unsetRegistry();
     }
     $this->queries = 0;
     $this->time = 0;
 }
開發者ID:Eli-TW,項目名稱:Codeception,代碼行數:15,代碼來源:ZF2.php

示例6: _after

 public function _after(\Codeception\TestCase $test)
 {
     $_SESSION = [];
     $_GET = [];
     $_POST = [];
     $_COOKIE = [];
     // reset singleton
     StaticEventManager::resetInstance();
     // Reset singleton placeholder if version < 2.2.0, no longer required in 2.2.0+
     if (Version::compareVersion('2.2.0') >= 0) {
         Placeholder\Registry::unsetRegistry();
     }
     //Close the session, if any are open
     if (session_status() == PHP_SESSION_ACTIVE) {
         session_write_close();
     }
     $this->queries = 0;
     $this->time = 0;
 }
開發者ID:namnv609,項目名稱:Codeception,代碼行數:19,代碼來源:ZF2.php

示例7: __construct

 /**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     $this->setRegistry(Registry::getRegistry());
     $this->setContainer($this->getRegistry()->getContainer($this->_regKey));
 }
開發者ID:alab1001101,項目名稱:zf2,代碼行數:10,代碼來源:Standalone.php

示例8: reset

 /**
  * Reset the request
  *
  * @return AbstractControllerTestCase
  */
 public function reset()
 {
     // force to re-create all components
     $this->application = null;
     // reset server datas
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     // reset singleton
     StaticEventManager::resetInstance();
     Placeholder\Registry::unsetRegistry();
     return $this;
 }
開發者ID:razvansividra,項目名稱:pnlzf2-1,代碼行數:19,代碼來源:AbstractControllerTestCase.php

示例9: 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

示例10: __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

示例11: _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

示例12: 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

示例13: tearDown

 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->placeholder);
     PlaceholderRegistry::unsetRegistry();
 }
開發者ID:benivaldo,項目名稱:zf2-na-pratica,代碼行數:11,代碼來源:PlaceholderTest.php

示例14: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     \Zend\View\Helper\Placeholder\Registry::unsetRegistry();
     $this->basePath = __DIR__ . '/_files/modules';
     $this->helper = new Foo();
 }
開發者ID:navassouza,項目名稱:zf2,代碼行數:12,代碼來源:StandaloneContainerTest.php

示例15: testGetRegistrySubsequentTimesReturnsSameInstance

 public function testGetRegistrySubsequentTimesReturnsSameInstance()
 {
     $registry1 = Registry::getRegistry();
     $registry2 = Registry::getRegistry();
     $this->assertSame($registry1, $registry2);
 }
開發者ID:navassouza,項目名稱:zf2,代碼行數:6,代碼來源:RegistryTest.php


注:本文中的Zend\View\Helper\Placeholder\Registry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。