Currently, if a template includes template via an absolute path that is inherited, and the parent of the inherited template is linked relatively e.g. {extends "../root.html"}, an exception is thrown:
Dwoo\Compilation\Exception: Compilation error at line 1 in "file:tests/resources/include_extended/extended/extended.html" : Extends : When using an include path you can not reference a template into a parent directory (using ../)
Example:
This constellation leads to calling Dwoo\Template\File::setIncludePath($paths) with a null argument and results in the includePath attribute holding an array with a single null element [0=>null]
instead of an empty array, which this PR proposes.
This is affects Dwoo\Template\File::templateFactory:
if ($includePath = $parentTemplate->getIncludePath()) {
and throws the mentioned exception.
I have also included a test case for this constellation.
Currently, if a template includes template via an absolute path that is inherited, and the parent of the inherited template is linked relatively e.g.
{extends "../root.html"}
, an exception is thrown:Dwoo\Compilation\Exception: Compilation error at line 1 in "file:tests/resources/include_extended/extended/extended.html" : Extends : When using an include path you can not reference a template into a parent directory (using ../)
Example:including.html
:some/path/extended/extended.html
:some/path/root.html
:This constellation leads to calling
Dwoo\Template\File::setIncludePath($paths)
with a null argument and results in theincludePath
attribute holding an array with a single null element[0=>null]
instead of an empty array, which this PR proposes.This is affects
Dwoo\Template\File::templateFactory
:and throws the mentioned exception.
I have also included a test case for this constellation.