Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • 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
    • Bridges
      • Nette

Classes

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