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
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Loader
  • SnippetBridge
  • Template
  • TemplateFactory
  • UIMacros
  • UIRuntime

Interfaces

  • ILatteFactory
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 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\Bridges\ApplicationLatte;
 9: 
10: use Latte;
11: use Nette;
12: 
13: 
14: /**
15:  * Runtime helpers for UI macros.
16:  * @internal
17:  */
18: class UIRuntime
19: {
20:     use Nette\StaticClass;
21: 
22:     /**
23:      * @return void
24:      */
25:     public static function initialize(Latte\Runtime\Template $template, &$parentName, array $blocks)
26:     {
27:         $providers = $template->global;
28:         $blocks = array_filter(array_keys($blocks), function ($s) { return $s[0] !== '_'; });
29:         if (
30:             $parentName === null
31:             && $blocks
32:             && !$template->getReferringTemplate()
33:             && isset($providers->uiControl) && $providers->uiControl instanceof Nette\Application\UI\Presenter
34:         ) {
35:             $parentName = $providers->uiControl->findLayoutTemplateFile();
36:         }
37: 
38:         // back compatiblity
39:         $params = $template->getParameters();
40:         if (empty($providers->uiControl) && isset($params['_control'])) {
41:             trigger_error('Replace template variable $_control with provider: $latte->addProvider("uiControl", ...)', E_USER_DEPRECATED);
42:             $providers->uiControl = $params['_control'];
43:         }
44:         if (empty($providers->uiPresenter) && isset($params['_presenter'])) {
45:             trigger_error('Replace template variable $_presenter with provider: $latte->addProvider("uiPresenter", ...)', E_USER_DEPRECATED);
46:             $providers->uiPresenter = $params['_presenter'];
47:         }
48:     }
49: }
50: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0