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


PHP EngineInterface::supports方法代码示例

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


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

示例1: setTemplateName

 /**
  * @inheritdoc
  */
 public function setTemplateName($templateName)
 {
     if (null === $this->templatingEngine) {
         throw new TemplatingException('Set template engine first');
     }
     if (!$this->templatingEngine->supports($templateName)) {
         throw new TemplateNotSupportedException(sprintf('Template %s is not supported by templating engine', $templateName));
     }
     $this->templateName = $templateName;
 }
开发者ID:videni,项目名称:NotificationBundle,代码行数:13,代码来源:BaseHandler.php

示例2: src

 /**
  * Gets the RequireJS src
  *
  * @return string Returns a string that represents the RequireJS src
  */
 public function src()
 {
     if ($this->engine->exists($this->requireJsSrc) && $this->engine->supports($this->requireJsSrc)) {
         return $this->engine->render($this->requireJsSrc);
     }
     return $this->requireJsSrc;
 }
开发者ID:BRS-software,项目名称:HearsayRequireJSBundle,代码行数:12,代码来源:RequireJSHelper.php

示例3: src

 /**
  * Gets the RequireJS src
  *
  * @return string Returns a string that represents the RequireJS src
  */
 public function src()
 {
     try {
         if ($this->engine->exists($this->requireJsSrc) && $this->engine->supports($this->requireJsSrc)) {
             return $this->engine->render($this->requireJsSrc);
         }
     } catch (\InvalidArgumentException $err) {
     }
     return $this->requireJsSrc;
 }
开发者ID:boskee,项目名称:HearsayRequireJSBundle,代码行数:15,代码来源:RequireJSHelper.php

示例4: render

 /**
  * {@inheritdoc}
  */
 public function render($name, array $parameters = [])
 {
     $event = new ViewEvent('render', $name);
     $event->setParameters(array_replace($this->globals, end($this->parameters) ?: [], $parameters));
     $this->events->trigger($event, [$this]);
     if (!$event->isPropagationStopped()) {
         $name = preg_replace('/\\.php$/i', '', $name);
         $this->events->trigger($event->setName($name), [$this]);
     }
     $result = $event->getResult();
     $params = $this->parameters[] = $event->getParameters();
     if ($result === null && $this->engine->supports($event->getTemplate())) {
         $result = $this->engine->render($event->getTemplate(), array_replace(['params' => new ArrObject($params)], $params));
     }
     array_pop($this->parameters);
     return $result;
 }
开发者ID:LibraryOfLawrence,项目名称:pagekit,代码行数:20,代码来源:View.php

示例5: supports

 public function supports($name)
 {
     return $this->engine->supports($name);
 }
开发者ID:foreverglory,项目名称:admin-bundle,代码行数:4,代码来源:TwigEngine.php


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