Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • Engine
  • 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: use Latte;
12: 
13: 
14: /**
15:  * @deprecated
16:  */
17: class Engine extends Latte\Engine
18: {
19:     private $fixed = FALSE;
20: 
21:     public function __construct()
22:     {
23:         $this->getParser()->shortNoEscape = TRUE;
24:         $this->addFilter('url', 'rawurlencode');
25:         foreach (array('normalize', 'toAscii', 'webalize', 'padLeft', 'padRight', 'reverse') as $name) {
26:             $this->addFilter($name, 'Nette\Utils\Strings::' . $name);
27:         }
28:     }
29: 
30: 
31:     public function __invoke($s)
32:     {
33:         trigger_error(__METHOD__ . '() is deprecated; use compile() instead.', E_USER_DEPRECATED);
34:         return $this->setLoader(new Latte\Loaders\StringLoader)->compile($s);
35:     }
36: 
37: 
38:     public function getCompiler()
39:     {
40:         $compiler = parent::getCompiler();
41:         if (!$this->fixed) {
42:             $this->fixed = TRUE;
43:             $compiler->addMacro('cache', new Nette\Bridges\CacheLatte\CacheMacro($compiler));
44:             Nette\Bridges\ApplicationLatte\UIMacros::install($compiler);
45:             Nette\Bridges\FormsLatte\FormMacros::install($compiler);
46:         }
47:         return $compiler;
48:     }
49: 
50: 
51:     public function & __get($name)
52:     {
53:         switch (strtolower($name)) {
54:             case 'parser':
55:             case 'compiler':
56:                 $method = 'get' . ucfirst($name);
57:                 trigger_error("Magic getters are deprecated. Use $method() method instead.", E_USER_DEPRECATED);
58:                 $return = $this->$method(); // return by reference
59:                 return $return;
60:         }
61: 
62:         return parent::__get($name);
63:     }
64: 
65: }
66: 
Nette 2.2 API documentation generated by ApiGen 2.8.0