Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • none

Classes

  • Compiler
  • Engine
  • HtmlNode
  • MacroNode
  • MacroTokens
  • Parser
  • PhpWriter
  • Token

Interfaces

  • IMacro

Exceptions

  • CompileException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Latte;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * Templating engine Latte.
15:  *
16:  * @author     David Grudl
17:  */
18: class Engine extends Nette\Object
19: {
20:     /** @var Parser */
21:     private $parser;
22: 
23:     /** @var Compiler */
24:     private $compiler;
25: 
26: 
27:     public function __construct()
28:     {
29:         $this->parser = new Parser;
30:         $this->compiler = new Compiler;
31:         $this->compiler->defaultContentType = Compiler::CONTENT_HTML;
32: 
33:         Macros\CoreMacros::install($this->compiler);
34:         $this->compiler->addMacro('cache', new Macros\CacheMacro($this->compiler));
35:         Macros\UIMacros::install($this->compiler);
36:         Macros\FormMacros::install($this->compiler);
37:     }
38: 
39: 
40:     /**
41:      * Invokes filter.
42:      * @param  string
43:      * @return string
44:      */
45:     public function __invoke($s)
46:     {
47:         return $this->compiler->compile($this->parser->parse($s));
48:     }
49: 
50: 
51:     /**
52:      * @return Parser
53:      */
54:     public function getParser()
55:     {
56:         return $this->parser;
57:     }
58: 
59: 
60:     /**
61:      * @return Compiler
62:      */
63:     public function getCompiler()
64:     {
65:         return $this->compiler;
66:     }
67: 
68: }
69: 
Nette 2.1 API documentation generated by ApiGen 2.8.0