mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 11:44:16 +02:00
- update scope handling
This commit is contained in:
@@ -58,8 +58,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $valid_scopes = array('local' => true, 'parent' => true, 'root' => true, 'global' => true,
|
||||
'smarty' => true, 'tpl_root' => true);
|
||||
public $valid_scopes = array('local' => true, 'parent' => true, 'root' => true,
|
||||
'tpl_root' => true);
|
||||
|
||||
/**
|
||||
* Compiles code for the {include} tag
|
||||
@@ -124,16 +124,11 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
||||
$_scope = Smarty::SCOPE_PARENT;
|
||||
} elseif ($_attr['scope'] == 'root') {
|
||||
$_scope = Smarty::SCOPE_ROOT;
|
||||
} elseif ($_attr['scope'] == 'global') {
|
||||
$_scope = Smarty::SCOPE_GLOBAL;
|
||||
} elseif ($_attr['scope'] == 'smarty') {
|
||||
$_scope = Smarty::SCOPE_SMARTY;
|
||||
} elseif ($_attr['scope'] == 'tpl_root') {
|
||||
$_scope = Smarty::SCOPE_TPL_ROOT;
|
||||
}
|
||||
if ($_attr['bubble_up'] === true) {
|
||||
$_scope = $_scope + Smarty::SCOPE_BUBBLE_UP;
|
||||
}
|
||||
$_scope += (isset($_attr[ 'bubble_up' ]) && $_attr[ 'bubble_up' ] == 'false') ? 0 :
|
||||
Smarty::SCOPE_BUBBLE_UP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user