Packages

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

Classes

  • NHtmlNode
  • NLatteCompiler
  • NLatteFilter
  • NLatteToken
  • NMacroNode
  • NMacroTokenizer
  • NParser
  • NPhpWriter

Interfaces

  • IMacro

Exceptions

  • NCompileException
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  *
 6:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 7:  *
 8:  * For the full copyright and license information, please view
 9:  * the file license.txt that was distributed with this source code.
10:  * @package Nette\Latte
11:  */
12: 
13: 
14: 
15: /**
16:  * Templating engine Latte.
17:  *
18:  * @author     David Grudl
19:  * @package Nette\Latte
20:  */
21: class NLatteFilter extends NObject
22: {
23:     /** @var NParser */
24:     private $parser;
25: 
26:     /** @var NLatteCompiler */
27:     private $compiler;
28: 
29: 
30:     public function __construct()
31:     {
32:         $this->parser = new NParser;
33:         $this->compiler = new NLatteCompiler;
34:         $this->compiler->defaultContentType = NLatteCompiler::CONTENT_XHTML;
35: 
36:         NCoreMacros::install($this->compiler);
37:         $this->compiler->addMacro('cache', new NCacheMacro($this->compiler));
38:         NUIMacros::install($this->compiler);
39:         NFormMacros::install($this->compiler);
40:     }
41: 
42: 
43:     /**
44:      * Invokes filter.
45:      * @param  string
46:      * @return string
47:      */
48:     public function __invoke($s)
49:     {
50:         return $this->compiler->compile($this->parser->parse($s));
51:     }
52: 
53: 
54:     /**
55:      * @return NParser
56:      */
57:     public function getParser()
58:     {
59:         return $this->parser;
60:     }
61: 
62: 
63:     /**
64:      * @return NLatteCompiler
65:      */
66:     public function getCompiler()
67:     {
68:         return $this->compiler;
69:     }
70: 
71: }
72: 
Nette Framework 2.0.12 (for PHP 5.2, prefixed) API API documentation generated by ApiGen 2.8.0