MAPG-238 include view with @include
soko-web/pipeline/pr-master This commit looks good

This commit is contained in:
bence committed 2023-05-27 10:56:20 +02:00
1 parent 78f891fbff
commit 754a23706a
1 file changed
+5
+5
View File
@@ -97,8 +97,13 @@ class Linker
fwrite($outputFileHandle, $extra[0]);
while (($line = fgets($inputFileHandle)) !== false) {
if (preg_match('/^\s*@include\((.*)\)\s*$/', $line, $matches) === 1) {
$include = file_get_contents(ROOT . '/views/' . $matches[1] . '.php');
fwrite($outputFileHandle, $include);
} else {
fwrite($outputFileHandle, $line);
}
}
fwrite($outputFileHandle, $extra[1]);
fclose($inputFileHandle);