Open zodinyac opened 6 years ago
The following code doesn't work:
$str = new Dwoo\Template\Str('{include(file="test.tpl")}'); echo $tpl->get($str);
$str is Str object and doesn't have correct templateFactory.
$str
Str
templateFactory
When I do
$str = new Dwoo\Template\Str('{include(file="file:test.tpl")}'); echo $tpl->get($str);
It works when I added to File::templateFactory the following code:
File::templateFactory
if ($parentTemplate === null) { $parentTemplate = $core->getTemplate(); } if (!($parentTemplate instanceof self)) { // added $includePath = $core->getTemplateDir(); // added } // added if ($parentTemplate instanceof self) {
And removed:
$class = 'Dwoo\Template\File'; if ($parentTemplate) { $class = get_class($parentTemplate); // removed this line }
How I can fix this correctly? I can not use file templates from string templates.
The following code doesn't work:
$str
isStr
object and doesn't have correcttemplateFactory
.When I do
It works when I added to
File::templateFactory
the following code:And removed:
How I can fix this correctly? I can not use file templates from string templates.