* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Twig\CacheExtension; use Twig\Environment; use Twig\Extension\AbstractExtension; /** * Extension for caching template blocks with twig. * * @author Alexander */ class Extension extends AbstractExtension { private $cacheStrategy; /** * @param CacheStrategyInterface $cacheStrategy */ public function __construct(CacheStrategyInterface $cacheStrategy) { $this->cacheStrategy = $cacheStrategy; } /** * @return CacheStrategyInterface */ public function getCacheStrategy() { return $this->cacheStrategy; } /** * {@inheritDoc} */ public function getTokenParsers() { return array( new TokenParser\Cache(), ); } }