updated the compiler to first check if array values is set

This commit is contained in:
2017-10-30 20:50:56 +02:00
parent ccb3f09a34
commit 306a9b9613
19 changed files with 551 additions and 709 deletions

View File

@ -684,9 +684,20 @@ class Compiler extends Infusion
protected function loadEscapedCode($file, $target, $lineBites)
{
// get comment type
if ($target['comment_type'] == 1)
{
$commentType = "// ";
$_commentType = "";
}
else
{
$commentType = "<!--";
$_commentType = " -->";
}
// escape the code
$code = explode(PHP_EOL, $target['code']);
$code = PHP_EOL."// " .implode(PHP_EOL."// ",$code). PHP_EOL;
$code = PHP_EOL . $commentType . implode($_commentType . PHP_EOL . $commentType, $code) . $_commentType . PHP_EOL;
// get place holders
$placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']);
// build the data