@@ -974,13 +974,15 @@ function compileBlock($block, $parent_tags = null) {
974
974
$ tags = $ this ->multiplyTags($ parent_tags, $ block ->tags );
975
975
}
976
976
977
- $ this ->pushEnv();
977
+ $ env = $ this ->pushEnv();
978
978
$ lines = array();
979
979
$ blocks = array();
980
980
foreach ($ block->props as $ prop) {
981
981
$ this ->compileProp($ prop, $ block, $ tags, $ lines, $ blocks);
982
982
}
983
983
984
+ $ block->scope = $ env;
985
+
984
986
$ this ->pop();
985
987
986
988
$ nl = $ isRoot ? "\n" .$ indent :
@@ -1028,7 +1030,6 @@ function compileBlock($block, $parent_tags = null) {
1028
1030
return ob_get_clean ();
1029
1031
}
1030
1032
1031
-
1032
1033
// find the fully qualified tags for a block and its parent's tags
1033
1034
function multiplyTags ($ parents , $ current ) {
1034
1035
if ($ parents == null ) return $ current ;
@@ -1221,6 +1222,12 @@ function compileProp($prop, $block, $tags, &$_lines, &$_blocks) {
1221
1222
}
1222
1223
1223
1224
foreach ($ mixins as $ mixin ) {
1225
+ $ old_scope = null ;
1226
+ if (isset ($ mixin ->parent ->scope )) {
1227
+ $ old_scope = $ this ->env ;
1228
+ $ this ->env = $ mixin ->parent ->scope ;
1229
+ }
1230
+
1224
1231
$ have_args = false ;
1225
1232
if (isset ($ mixin ->args )) {
1226
1233
$ have_args = true ;
@@ -1238,6 +1245,10 @@ function compileProp($prop, $block, $tags, &$_lines, &$_blocks) {
1238
1245
$ mixin ->parent = $ old_parent ;
1239
1246
1240
1247
if ($ have_args ) $ this ->pop ();
1248
+
1249
+ if ($ old_scope ) {
1250
+ $ this ->env = $ old_scope ;
1251
+ }
1241
1252
}
1242
1253
1243
1254
break ;
0 commit comments