Skip to content

Commit 9dbfd53

Browse files
committed
UIMacros: uses getParameter()
1 parent 8f09d35 commit 9dbfd53

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/Bridges/ApplicationLatte/UIMacros.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function finalize()
6363
return [
6464
'if (Nette\Bridges\ApplicationLatte\UIRuntime::initialize($this, $this->blockQueue)) return;',
6565
'',
66-
$this->extends ? '' : '$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->params["_control"] instanceof Nette\Application\UI\Presenter
67-
? $this->params["_control"]->findLayoutTemplateFile() : NULL);',
66+
$this->extends ? '' : '$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->getParameter("_control") instanceof Nette\Application\UI\Presenter
67+
? $this->getParameter("_control")->findLayoutTemplateFile() : NULL);',
6868
];
6969
}
7070

@@ -132,7 +132,7 @@ public function macroExtends(MacroNode $node, PhpWriter $writer)
132132
if ($node->modifiers || $node->parentNode || $node->args !== 'auto') {
133133
return FALSE;
134134
}
135-
return $writer->write('$this->parentName = $this->params["_presenter"]->findLayoutTemplateFile();');
135+
return $writer->write('$this->parentName = $this->getParameter("_presenter")->findLayoutTemplateFile();');
136136
}
137137

138138

tests/Bridges.Latte/expected/UIMacros.dynamicsnippets.alt.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class Template%a% extends Latte\Template
3131
function prepare()
3232
{
3333
extract($this->params);
34-
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->params["_control"] instanceof Nette\Application\UI\Presenter
35-
? $this->params["_control"]->findLayoutTemplateFile() : NULL);
34+
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->getParameter("_control") instanceof Nette\Application\UI\Presenter
35+
? $this->getParameter("_control")->findLayoutTemplateFile() : NULL);
3636
return get_defined_vars();
3737
}
3838

tests/Bridges.Latte/expected/UIMacros.dynamicsnippets.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Template%a% extends Latte\Template
2727
function prepare()
2828
{
2929
extract($this->params);
30-
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->params["_control"] instanceof Nette\Application\UI\Presenter
31-
? $this->params["_control"]->findLayoutTemplateFile() : NULL);
30+
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->getParameter("_control") instanceof Nette\Application\UI\Presenter
31+
? $this->getParameter("_control")->findLayoutTemplateFile() : NULL);
3232
return get_defined_vars();
3333
}
3434

tests/Bridges.Latte/expected/UIMacros.snippet.alt.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class Template%a% extends Latte\Template
4343
function prepare()
4444
{
4545
extract($this->params);
46-
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->params["_control"] instanceof Nette\Application\UI\Presenter
47-
? $this->params["_control"]->findLayoutTemplateFile() : NULL);
46+
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->getParameter("_control") instanceof Nette\Application\UI\Presenter
47+
? $this->getParameter("_control")->findLayoutTemplateFile() : NULL);
4848
return get_defined_vars();
4949
}
5050

tests/Bridges.Latte/expected/UIMacros.snippet.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class Template%a% extends Latte\Template
4949
function prepare()
5050
{
5151
extract($this->params);
52-
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->params["_control"] instanceof Nette\Application\UI\Presenter
53-
? $this->params["_control"]->findLayoutTemplateFile() : NULL);
52+
$this->parentName = $this->parentName ?: ($this->blocks && !$this->getReferringTemplate() && $this->getParameter("_control") instanceof Nette\Application\UI\Presenter
53+
? $this->getParameter("_control")->findLayoutTemplateFile() : NULL);
5454
return get_defined_vars();
5555
}
5656

0 commit comments

Comments
 (0)