本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: supports
public function supports($name)
{
return $this->engine->supports($name);
}