Symfony\Component\Templating\EngineInterface::supports PHP Method

supports() public method

Returns true if this class is able to render the given template.
public supports ( mixed $name ) : boolean
$name mixed A template name or a TemplateReferenceInterface instance
return boolean true if this class supports the given template, false otherwise
    function supports($name);

Usage Example

 /**
  * @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;
 }
All Usage Examples Of Symfony\Component\Templating\EngineInterface::supports