當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。