Latte\Engine::getParser PHP Method

getParser() public method

public getParser ( ) : Parser
return Parser
    public function getParser()
    {
        if (!$this->parser) {
            $this->parser = new Parser();
        }
        return $this->parser;
    }

Usage Example

Beispiel #1
0
 public function __construct(CacheProvider $cache, Config $config)
 {
     $this->cache = $cache;
     $this->latte = new Engine();
     $parser = $this->latte->getParser();
     $parser->defaultSyntax = $config->default_syntax;
     $this->latte->setTempDirectory($cache->config->temp_dir);
 }