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


PHP ModelInterface::captureTo方法代码示例

本文整理汇总了PHP中Zend\View\Model\ModelInterface::captureTo方法的典型用法代码示例。如果您正苦于以下问题:PHP ModelInterface::captureTo方法的具体用法?PHP ModelInterface::captureTo怎么用?PHP ModelInterface::captureTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\View\Model\ModelInterface的用法示例。


在下文中一共展示了ModelInterface::captureTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: determineAnonymousBlockId

 /**
  *
  * @param ViewModel $block
  * @return string
  */
 protected function determineAnonymousBlockId(ModelInterface $block)
 {
     $blockId = $block->getVariable(self::BLOCK_ID_VAR);
     if (!$blockId) {
         $blockId = sprintf(self::ANONYMOUS_ID_PATTERN, $block->captureTo(), self::$anonymousSuffix++);
         $block->setVariable(self::BLOCK_ID_VAR, $blockId);
     }
     return $blockId;
 }
开发者ID:adamdyson,项目名称:ConLayout,代码行数:14,代码来源:Layout.php

示例2: determineAnonymousBlockId

 /**
  * @param ModelInterface $block
  * @return mixed|string
  */
 private function determineAnonymousBlockId(ModelInterface $block)
 {
     $blockId = $block->getOption('block_id');
     if (!$blockId) {
         $blockId = sprintf(self::ANONYMOUS_ID_PATTERN, $block->captureTo(), self::$anonymousSuffix++);
         $block->setOption('block_id', $blockId);
     }
     return $blockId;
 }
开发者ID:hummer2k,项目名称:conlayout,代码行数:13,代码来源:BlockPool.php

示例3: getCaptureTo

 /**
  * retrieve parent and capture_to as array, e.g.: [ 'layout', 'content' ]
  * so we are able to list() block_id and capture_to values
  *
  * @param   ModelInterface  $block
  * @return  array
  */
 protected function getCaptureTo(ModelInterface $block)
 {
     $captureTo = $block->captureTo();
     if ($parent = $block->getOption('parent')) {
         $captureTo = explode(self::CAPTURE_TO_DELIMITER, $captureTo);
         return [$parent, end($captureTo)];
     }
     if (false !== strpos($captureTo, self::CAPTURE_TO_DELIMITER)) {
         return explode(self::CAPTURE_TO_DELIMITER, $captureTo);
     }
     return [self::BLOCK_ID_ROOT, $captureTo];
 }
开发者ID:hummer2k,项目名称:conlayout,代码行数:19,代码来源:Layout.php


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