php Zend-View-Helper-Placeholder-Registry类(方法)实例源码

下面列出了php Zend-View-Helper-Placeholder-Registry 类(方法)源码代码实例,从而了解它的用法。

作者:razvansividr    项目:pnlzf2-   
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();
 }

作者:siad00    项目:ctrlli   
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);
 }

作者:benivald    项目:zf2-na-pratic   
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'));
 }

作者:Naszvadi    项目:ImageCM   
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;
 }

作者:Eli-T    项目:Codeceptio   
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;
 }

作者:namnv60    项目:Codeceptio   
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;
 }

作者:alab100110    项目:zf   
/**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     $this->setRegistry(Registry::getRegistry());
     $this->setContainer($this->getRegistry()->getContainer($this->_regKey));
 }

作者:razvansividr    项目:pnlzf2-   
/**
  * 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;
 }

作者:rafalwrzeszc    项目:zf   
/**
  * 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;
 }

作者:nevvermin    项目:zf   
/**
  * Constructor
  *
  * Retrieve container registry from Zend_Registry, or create new one and register it.
  *
  * @return void
  */
 public function __construct()
 {
     $this->_registry = Placeholder\Registry::getRegistry();
 }

作者:hjr    项目:zf   
/**
  * 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;
 }

作者:heiglandrea    项目:zf   
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);
 }

作者:benivald    项目:zf2-na-pratic   
/**
  * 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();
 }

作者:navassouz    项目:zf   
/**
  * 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();
 }

作者:navassouz    项目:zf   
public function testGetRegistrySubsequentTimesReturnsSameInstance()
 {
     $registry1 = Registry::getRegistry();
     $registry2 = Registry::getRegistry();
     $this->assertSame($registry1, $registry2);
 }

作者:rexma    项目:zf   
/**
  * 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);
 }

作者:pnaq5    项目:zf2dem   
/**
  * @group ZF-10793
  */
 public function testSetValueCreateContainer()
 {
     $this->registry->setContainerClass('ZendTest\\View\\Helper\\Placeholder\\MockContainer');
     $data = array('ZF-10793');
     $container = $this->registry->createContainer('foo', $data);
     $this->assertEquals(array('ZF-10793'), $container->data);
 }


问题


面经


文章

微信
公众号

扫码关注公众号