本文整理匯總了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);
}