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


PHP Control::getSnippetId方法代码示例

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


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

示例1: addSnippet

 public function addSnippet($name, $content)
 {
     if ($this->payload === NULL) {
         $this->payload = $this->control->getPresenter()->getPayload();
     }
     $this->payload->snippets[$this->control->getSnippetId($name)] = $content;
 }
开发者ID:hrach,项目名称:nette-application,代码行数:7,代码来源:SnippetBridge.php

示例2: renderSnippets

 public static function renderSnippets(UI\Control $control, \stdClass $local, array $params)
 {
     $control->snippetMode = FALSE;
     $payload = $control->getPresenter()->getPayload();
     if (isset($local->blocks)) {
         foreach ($local->blocks as $name => $function) {
             if ($name[0] !== '_' || !$control->isControlInvalid((string) substr($name, 1))) {
                 continue;
             }
             ob_start(function () {
             });
             $function = reset($function);
             $snippets = $function($local, $params + array('_snippetMode' => TRUE));
             $payload->snippets[$id = $control->getSnippetId((string) substr($name, 1))] = ob_get_clean();
             if ($snippets !== NULL) {
                 // pass FALSE from snippetArea
                 if ($snippets) {
                     $payload->snippets += $snippets;
                 }
                 unset($payload->snippets[$id]);
             }
         }
     }
     $control->snippetMode = TRUE;
     if ($control instanceof UI\IRenderable) {
         $queue = array($control);
         do {
             foreach (array_shift($queue)->getComponents() as $child) {
                 if ($child instanceof UI\IRenderable) {
                     if ($child->isControlInvalid()) {
                         $child->snippetMode = TRUE;
                         $child->render();
                         $child->snippetMode = FALSE;
                     }
                 } elseif ($child instanceof Nette\ComponentModel\IContainer) {
                     $queue[] = $child;
                 }
             }
         } while ($queue);
     }
 }
开发者ID:knedle,项目名称:twitter-nette-skeleton,代码行数:41,代码来源:UIRuntime.php

示例3: getSnippetId

 public function getSnippetId($name = NULL)
 {
     return $this->control->getSnippetId($name);
 }
开发者ID:dotblue,项目名称:nette-control-rendering,代码行数:4,代码来源:Renderer.php

示例4: renderSnippets

 public static function renderSnippets(Nette\Application\UI\Control $control, \stdClass $local, array $params)
 {
     $control->snippetMode = false;
     $payload = $control->getPresenter()->getPayload();
     if (isset($local->blocks)) {
         foreach ($local->blocks as $name => $function) {
             if ($name[0] !== '_' || !$control->isControlInvalid(substr($name, 1))) {
                 continue;
             }
             ob_start();
             $function = reset($function);
             $snippets = $function($local, $params);
             $payload->snippets[$id = $control->getSnippetId(substr($name, 1))] = ob_get_clean();
             if ($snippets) {
                 $payload->snippets += $snippets;
                 unset($payload->snippets[$id]);
             }
         }
     }
     $control->snippetMode = true;
     if ($control instanceof Nette\Application\UI\IRenderable) {
         $queue = array($control);
         do {
             foreach (array_shift($queue)->getComponents() as $child) {
                 if ($child instanceof Nette\Application\UI\IRenderable) {
                     if ($child->isControlInvalid()) {
                         $child->snippetMode = true;
                         $child->render();
                         $child->snippetMode = false;
                     }
                 } elseif ($child instanceof Nette\ComponentModel\IContainer) {
                     $queue[] = $child;
                 }
             }
         } while ($queue);
     }
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:37,代码来源:UIMacros.php

示例5: getSnippetId

 public function getSnippetId($name = NULL) : string
 {
     $uniqueId = $this->getUniqueId();
     return str_replace($uniqueId, implode('-', [$uniqueId, isset($this->views[$name]) ? $name : $this->view]), parent::getSnippetId(isset($this->views[$name]) ? NULL : $name));
 }
开发者ID:ytnuk,项目名称:application,代码行数:5,代码来源:Control.php

示例6:

Nette\InvalidStateException("Cannot include undefined parent block '$name'.");}$block($context,$params);}static
function
renderSnippets(Nette\Application\UI\Control$control,\stdClass$local,array$params){$control->snippetMode=FALSE;$payload=$control->getPresenter()->getPayload();if(isset($local->blocks)){foreach($local->blocks
as$name=>$function){if($name[0]!=='_'||!$control->isControlInvalid(substr($name,1))){continue;}ob_start();$function=reset($function);$snippets=$function($local,$params);$payload->snippets[$id=$control->getSnippetId(substr($name,1))]=ob_get_clean();if($snippets){$payload->snippets+=$snippets;unset($payload->snippets[$id]);}}}if($control
instanceof
Nette\Application\UI\IRenderable){$queue=array($control);do{foreach(array_shift($queue)->getComponents()as$child){if($child
instanceof
Nette\Application\UI\IRenderable){if($child->isControlInvalid()){$child->snippetMode=TRUE;$child->render();$child->snippetMode=FALSE;}}elseif($child
instanceof
Nette\ComponentModel\IContainer){$queue[]=$child;}}}while($queue);}}}}namespace Nette\Utils{use
开发者ID:JanTvrdik,项目名称:NetteExtras,代码行数:10,代码来源:loader.php

示例7: getSnippetId

 /**
  * Custom snippet format
  */
 public function getSnippetId($name = NULL)
 {
     if ($this->snippetGenerator === NULL) {
         return parent::getSnippetId($name);
     }
     return $this->snippetGenerator->getSnippetId($this, $name);
 }
开发者ID:zaxxx,项目名称:zaxcms,代码行数:10,代码来源:Control.php


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