Twig_Environment::getCacheFilename PHP Method

getCacheFilename() public method

Gets the cache filename for a given template.
public getCacheFilename ( string $name ) : string
$name string The template name
return string The cache file name
    public function getCacheFilename($name)
    {
        if (false === $this->cache) {
            return false;
        }

        $class = substr($this->getTemplateClass($name), strlen($this->templateClassPrefix));

        return $this->getCache().'/'.substr($class, 0, 2).'/'.substr($class, 2, 2).'/'.substr($class, 4).'.php';
    }

Same methods

Twig_Environment::getCacheFilename ( $name )

Usage Example

 public function addTemplate($path)
 {
     $this->environment->loadTemplate($path);
     $this->templates[] = $this->environment->getCacheFilename($path);
 }
All Usage Examples Of Twig_Environment::getCacheFilename