Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
模板加入常量的使用方法<{#ROOT}>语法, 感谢9527的提供
  • Loading branch information
SpeedPHP committed Jun 26, 2017
1 parent a4de2f5 commit 03b57e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions protected/lib/speed.php
Expand Up @@ -423,6 +423,7 @@ private function _compile_struct($template_data){
$foreach_inner_after = '<?php $_foreach_$3_index = $_foreach_$3_counter;$_foreach_$3_iteration = $_foreach_$3_counter + 1;$_foreach_$3_first = ($_foreach_$3_counter == 0);$_foreach_$3_last = ($_foreach_$3_counter == $_foreach_$3_total - 1);$_foreach_$3_counter++;?>';
$pattern_map = array(
'<{\*([\s\S]+?)\*}>' => '<?php /* $1*/?>',
'<{#(.*?)}>' => '<?php echo $1; ?>',
'(<{((?!}>).)*?)(\$[\w\_\"\'\[\]]+?)\.(\w+)(.*?}>)' => '$1$3[\'$4\']$5',
'(<{.*?)(\$(\w+)@(index|iteration|first|last|total))+(.*?}>)' => '$1$_foreach_$3_$4$5',
'<{(\$[\$\w\.\_\"\'\[\]]+?)\snofilter\s*}>' => '<?php echo $1; ?>',
Expand Down

0 comments on commit 03b57e4

Please sign in to comment.