/** * {@inheritdoc} */ public function load($key) { try { $content = $this->filesystem->get($key); eval('?>' . $content); } catch (Exception $e) { } }
/** * {@inheritdoc} */ public function getSource($name) { $key = $this->getCacheKey($name); if (isset($this->cache[$key])) { return $this->cache[$key]; } // Get source $source = $this->filesystem->get($this->getTemplatePath($name)); // Extend all non layout templates if ($name !== 'layout.twig' && substr($name, 0, 8) !== 'widgets/') { return $this->cache[$key] = '{% extends "layout.twig" %}' . $source; } return $this->cache[$key] = $source; }