Includeblock cannot use variable with string

5 years ago

Heiko
Member | 4
+
0
-

Hi.
I don't know, if it's bug or intention.

I have the code in template:

<?php
{includeblock $templateDir . '/template.latte'}
?>

Error is syntax error, unexpected ‘.’, expecting ‘)’

And code:

<?php
$_l->templates['2913931254']->renderChildTemplate($templateDir, array(. '/blocks.latte') + get_defined_vars())
?>

Last edited by Heiko (2014-08-26 14:42)

5 years ago

David Matějka
Moderator | 5914
+
0
-

I think it's a bug. Try this:

{includeblock $templateDir.'/template.latte'}

5 years ago

Heiko
Member | 4
+
0
-

I have tried this and I got same error.

5 years ago

David Matějka
Moderator | 5914
+
0
-

Weird, I have tried it and it works.
Did you really strip spaces around the dot?

5 years ago

Heiko
Member | 4
+
0
-

Sorry for mistake. It works.