/** * {@inheritdoc} */ public function exists($name) { if ($this->loader instanceof \Twig_ExistsLoaderInterface) { return $this->loader->exists($name); } else { try { $this->loader->getSource($name); return true; } catch (\Twig_Error_Loader $e) { return false; } } }