Merge pull request 'MAPG-238 include view with @include' () from feature/MAPG-238-include-possibility-for-templating-engine into master

Reviewed-on: 
This commit is contained in:
Bence Pőcze 2023-05-28 15:45:10 +02:00
commit 6fdd25ae4b
Signed by: Gitea
GPG Key ID: 7B89B83EED9AD2C6

@ -97,7 +97,12 @@ class Linker
fwrite($outputFileHandle, $extra[0]);
while (($line = fgets($inputFileHandle)) !== false) {
fwrite($outputFileHandle, $line);
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]);