Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
29 changed files
with
318 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
named arguments | ||
|
||
|
||
a) Variables 1, , | ||
|
||
|
||
b) Variables , 1, | ||
|
||
|
||
c) Variables , , | ||
|
||
|
||
d) Variables 2, 1, | ||
// invalid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
%A% | ||
|
||
final class Template%a% extends Latte\Runtime\Template | ||
{ | ||
protected const BLOCKS = [ | ||
['test' => 'blockTest'], | ||
]; | ||
|
||
|
||
public function main(): array | ||
{ | ||
extract($this->params); | ||
echo 'named arguments | ||
'; | ||
if ($this->getParentName()) { | ||
return get_defined_vars(); | ||
} | ||
echo ' | ||
a) '; | ||
$this->renderBlock($__nm = 'test', [1, 'var1' => 2] + [], 'html'); | ||
echo ' | ||
b) '; | ||
$this->renderBlock($__nm = 'test', ['var2' => 1] + [], 'html'); | ||
echo ' | ||
c) '; | ||
$this->renderBlock($__nm = 'test', ['hello' => 1] + [], 'html'); | ||
echo ' | ||
d) '; | ||
$this->renderBlock($__nm = 'test', ['var2' => 1, 2] + [], 'html'); | ||
echo ' // invalid'; | ||
return get_defined_vars(); | ||
} | ||
|
||
|
||
public function blockTest(array $__args): void | ||
{ | ||
extract($this->params); | ||
$var1 = $__args[0] ?? $__args['var1'] ?? null; | ||
$var2 = $__args[1] ?? $__args['var2'] ?? null; | ||
$var3 = $__args[2] ?? $__args['var3'] ?? null; | ||
echo ' Variables '; | ||
echo LR\Filters::escapeHtmlText($var1) /* line 4 */; | ||
echo ', '; | ||
echo LR\Filters::escapeHtmlText($var2) /* line 4 */; | ||
echo ', '; | ||
echo LR\Filters::escapeHtmlText($var3) /* line 4 */; | ||
echo "\n"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
%A% | ||
|
||
final class Template%a% extends Latte\Runtime\Template | ||
{ | ||
protected const BLOCKS = [ | ||
['test' => 'blockTest'], | ||
]; | ||
|
||
|
||
public function main(): array | ||
{ | ||
extract($this->params); | ||
echo 'named arguments order | ||
a) '; | ||
$this->renderBlock($__nm = 'test', [1, 'var1' => 2] + [], 'html'); | ||
echo ' | ||
b) '; | ||
$this->renderBlock($__nm = 'test', ['var2' => 1] + [], 'html'); | ||
echo ' | ||
c) '; | ||
$this->renderBlock($__nm = 'test', ['hello' => 1] + [], 'html'); | ||
echo ' | ||
'; | ||
if ($this->getParentName()) { | ||
return get_defined_vars(); | ||
} | ||
return get_defined_vars(); | ||
} | ||
|
||
|
||
public function blockTest(array $__args): void | ||
{ | ||
extract($this->params); | ||
$var1 = $__args[0] ?? $__args['var1'] ?? null; | ||
$var2 = $__args[1] ?? $__args['var2'] ?? null; | ||
$var3 = $__args[2] ?? $__args['var3'] ?? null; | ||
echo ' Variables '; | ||
echo LR\Filters::escapeHtmlText($var1) /* line 10 */; | ||
echo ', '; | ||
echo LR\Filters::escapeHtmlText($var2) /* line 10 */; | ||
echo ', '; | ||
echo LR\Filters::escapeHtmlText($var3) /* line 10 */; | ||
echo "\n"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
named arguments import | ||
|
||
|
||
a) Variables 1, , | ||
|
||
|
||
b) Variables , 1, | ||
|
||
|
||
c) Variables , , |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
%A% | ||
|
||
final class Template%a% extends Latte\Runtime\Template | ||
{ | ||
|
||
public function main(): array | ||
{ | ||
extract($this->params); | ||
echo ' | ||
named arguments import | ||
'; | ||
$this->createTemplate("import.latte", $this->params, "import")->render(); | ||
echo ' | ||
a) '; | ||
$this->renderBlock($__nm = 'test', [1, 'var1' => 2] + [], 'html'); | ||
echo ' | ||
b) '; | ||
$this->renderBlock($__nm = 'test', ['var2' => 1] + [], 'html'); | ||
echo ' | ||
c) '; | ||
$this->renderBlock($__nm = 'test', ['hello' => 1] + [], 'html'); | ||
return get_defined_vars(); | ||
} | ||
|
||
} |
Oops, something went wrong.