Parcourir la source

Fix exist and existelse rendering for compiled templates

Nathaniel van Diepen il y a 7 ans
Parent
commit
234b0d0e81
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      Data/template.class.php

+ 2 - 1
Data/template.class.php

@@ -110,7 +110,7 @@
 							$output = preg_replace_callback(static::$regex['existelse'], function($matches){
 								$output = "<?php if(isset(\$data[".var_export($matches[1], true)."])): ?>";
 								$output .= static::compile($matches[2]);
-								$output .= "<php else: ?>";
+								$output .= "<?php else: ?>";
 								$output .= static::compile($matches[3]);
 								$output .= "<?php endif; ?>";
 								return $output;
@@ -131,6 +131,7 @@
 								$output = "<?php if(isset(\$data[".var_export($matches[1], true)."])): ?>";
 								$output .= static::compile($matches[2]);
 								$output .= "<?php endif; ?>";
+								return $output;
 							}, $output);
 						}
 					],