• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_View_Helper_Placeholder_Registry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_View_Helper_Url类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_View_Helper_Placeholder_Container_Standalone类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap