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


PHP Zend_View_Helper_Placeholder_Registry類代碼示例

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


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

示例1: testSetValueCreateContainer

 /**
  * @group ZF-10793
  */
 public function testSetValueCreateContainer()
 {
     $this->registry->setContainerClass('Zend_View_Helper_Placeholder_RegistryTest_Container');
     $data = array('ZF-10793');
     $container = $this->registry->createContainer('foo', $data);
     $this->assertEquals(array('ZF-10793'), $container->data);
 }
開發者ID:ThorstenSuckow,項目名稱:conjoon,代碼行數:10,代碼來源:RegistryTest.php

示例2: testNamespaceRegisteredInPlaceholderRegistryAfterInstantiation

 public function testNamespaceRegisteredInPlaceholderRegistryAfterInstantiation()
 {
     $registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
     if ($registry->containerExists('Zend_View_Helper_HeadMeta')) {
         $registry->deleteContainer('Zend_View_Helper_HeadMeta');
     }
     $this->assertFalse($registry->containerExists('Zend_View_Helper_HeadMeta'));
     $helper = new Zend_View_Helper_HeadMeta();
     $this->assertTrue($registry->containerExists('Zend_View_Helper_HeadMeta'));
 }
開發者ID:lortnus,項目名稱:zf1,代碼行數:10,代碼來源:HeadMetaTest.php

示例3: renderAdmin

 public function renderAdmin($name, $placeholderName = 'content', $model = null)
 {
     $result = $this->view->placeholder($placeholderName)->toString();
     if ($this->_access()) {
         if (sizeof($model)) {
             foreach ($model as $k => $v) {
                 $this->view->{$k} = $v;
             }
         }
         $this->view->content = $result;
         $result = $this->view->render($name);
     }
     Zend_View_Helper_Placeholder_Registry::getRegistry()->deleteContainer($placeholderName);
     return $result;
 }
開發者ID:kytvi2p,項目名稱:ZettaFramework,代碼行數:15,代碼來源:RenderAdmin.php

示例4: wrap

 /**
  * Обрамляем текуший текст шаблоном
  *
  * @param string $text
  * @return string
  */
 public function wrap($name, $function = false, $placeholderName = 'body', $model = null)
 {
     if ('content_item' == $placeholderName || 'content' == $placeholderName) {
         $this->view->placeholder($placeholderName)->captureStart();
         $function();
         $this->view->placeholder($placeholderName)->captureEnd();
         return $this->view->renderAdmin($name, $placeholderName, $model);
     }
     $return = $resultEcho = false;
     if (is_callable($function)) {
         $this->view->placeholder($placeholderName)->captureStart();
         $return = $function();
         $this->view->placeholder($placeholderName)->captureEnd();
         $resultEcho = $this->view->placeholder($placeholderName)->toString();
         Zend_View_Helper_Placeholder_Registry::getRegistry()->deleteContainer($placeholderName);
     }
     $this->view->{$placeholderName} = $return ? $return : $resultEcho;
     $return = $this->view->render($name);
     unset($this->view->{$placeholderName});
     return $return;
 }
開發者ID:kytvi2p,項目名稱:ZettaFramework,代碼行數:27,代碼來源:Wrap.php

示例5: _initVarContainer

 /**
  * Initialize placeholder container for layout vars
  * 
  * @return Zend_View_Helper_Placeholder_Container
  */
 protected function _initVarContainer()
 {
     if (null === $this->_container) {
         require_once 'Zend/View/Helper/Placeholder/Registry.php';
         $this->_container = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer(__CLASS__);
     }
     return $this->_container;
 }
開發者ID:jcvpalma,項目名稱:avaliacao_desenv_php_zend17,代碼行數:13,代碼來源:Layout.php

示例6: __construct

 /**
  * Constructor
  * 
  * @return void
  */
 public function __construct()
 {
     $this->setRegistry(Zend_View_Helper_Placeholder_Registry::getRegistry());
     $registry = $this->getRegistry();
     $this->setContainer($this->getRegistry()->getContainer($this->_regKey));
 }
開發者ID:Mendim,項目名稱:gtv-resources,代碼行數:11,代碼來源:Standalone.php

示例7: testGetRegistryRegistersWithGlobalRegistry

 public function testGetRegistryRegistersWithGlobalRegistry()
 {
     $this->assertFalse(Zend_Registry::isRegistered(Zend_View_Helper_Placeholder_Registry::REGISTRY_KEY));
     $registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
     $this->assertTrue(Zend_Registry::isRegistered(Zend_View_Helper_Placeholder_Registry::REGISTRY_KEY));
     $registered = Zend_Registry::get(Zend_View_Helper_Placeholder_Registry::REGISTRY_KEY);
     $this->assertSame($registry, $registered);
 }
開發者ID:bradley-holt,項目名稱:zf2,代碼行數:8,代碼來源:RegistryTest.php

示例8: _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:kobmaki,項目名稱:icingaweb2,代碼行數:12,代碼來源:Layout.php

示例9: testSetMetaCharsetShouldOnlyAvailableForHtml5

 /**
  * @group ZF-10343
  */
 public function testSetMetaCharsetShouldOnlyAvailableForHtml5()
 {
     $charset = 'UTF-8';
     $options = array('doctype' => 'XHTML1_STRICT', 'charset' => $charset);
     $resource = new Zend_Application_Resource_View($options);
     $view = $resource->init();
     $headMetaHelper = $view->headMeta();
     $actual = null;
     $container = $headMetaHelper->getContainer();
     foreach ($container as $item) {
         if ('charset' == $item->type) {
             $actual = $item->charset;
             break;
         }
     }
     $this->assertFalse($view->doctype()->isHtml5());
     $this->assertNull($actual);
     $registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
     $registry->deleteContainer('Zend_View_Helper_HeadMeta');
     $registry->deleteContainer('Zend_View_Helper_Doctype');
 }
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:24,代碼來源:ViewTest.php

示例10: has

 /**
  * Checks whether a placeholder contains data or view variable exists
  *
  * @param string $name the name of the placeholder or view variable
  */
 public function has($name)
 {
     // check view variables
     if (isset($this->{$name}) && !empty($this->{$name}) && $this->{$name} != '') {
         return true;
     }
     // check placeholders
     if ($this->_placeholderRegistry->containerExists($name)) {
         $value = $this->_placeholderRegistry->getContainer($name)->getValue();
         if (is_array($value)) {
             foreach ($value as $v) {
                 if (!empty($v) && $v != '') {
                     return true;
                 }
             }
         } else {
             if (!empty($value) && $value != '') {
                 return true;
             }
         }
     }
     return false;
 }
開發者ID:dmj,項目名稱:uni-helmstedt.hab.de,代碼行數:28,代碼來源:View.php

示例11: placeholder

 /**
  * Placeholder helper
  * 
  * @param  string $name 
  * @return Zend_View_Helper_Placeholder_Container_Abstract
  */
 public function placeholder($name)
 {
     $name = (string) $name;
     return $this->_registry->getContainer($name);
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:11,代碼來源:Placeholder.php

示例12: testUsingCustomContainerClassCreatesContainersOfCustomClass

 public function testUsingCustomContainerClassCreatesContainersOfCustomClass()
 {
     $this->registry->setContainerClass('ZendTest\\View\\Helper\\Placeholder\\MockContainer');
     $container = $this->registry->createContainer('foo');
     $this->assertTrue($container instanceof MockContainer);
 }
開發者ID:heiglandreas,項目名稱:zf2,代碼行數:6,代碼來源:RegistryTest.php


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