Symfony\Component\Templating\PhpEngine::exists PHP Method

exists() public method

Returns true if the template exists.
public exists ( mixed $name ) : boolean
$name mixed A template name or a TemplateReferenceInterface instance
return boolean true if the template exists, false otherwise
    public function exists($name)
    {
        try {
            $this->load($name);
        } catch (\InvalidArgumentException $e) {
            return false;
        }

        return true;
    }