Closed Gappa closed 4 months ago
Thanks, it is working now 👍
Note for anyone updating - if you see this error, don't panic 🙂
The solution is easy - clear latte cache.
TypeError
Latte\Essential\CoreExtension::Latte\Essential\{closure}(): Argument #1 ($template) must be of type Latte\Runtime\Template, string given, called in /{path_to_project}/temp/cache/latte/Front-templates-@layout.latte--c33d85f130.php on line 321
Version: 3.0.13 earlier versions probably too - related issue: #345
Bug Description
{$this->hasBlock('test')}
yields different result than{hasBlock('test')}
.Relevant code:
When using
{$this->hasBlock()}
theLayerTop
array has many entries ofLatte\Runtime\Block
instances (key being the block's name), but it is empty when called using{hasBlock()}
. In fact, the whole$this->blocks
array only contains another empty arrays in this case.Steps To Reproduce
default.latte (template of a presenter's action)
@layout.latte (main layout)
Also, this in
@layout.latte
doesn't work:Result:
Which is strange, because on fiddle it works:
I tried to make a failing example on fiddle.nette.org/latte, but I'm not able to simulate the relation between
@layout.latte
and a presenter/action template.Expected Behavior
Both approaches have the same result.
Possible Solution
N/A