function Smarty_Compiler::_parse_conf_var in Quiz 6.5
Same name and namespace in other branches
- 6.6 includes/moodle/lib/smarty/Smarty_Compiler.class.php \Smarty_Compiler::_parse_conf_var()
parse configuration variable expression into PHP code
Parameters
string $conf_var_expr:
1 call to Smarty_Compiler::_parse_conf_var()
- Smarty_Compiler::_parse_var_props in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - compile single variable and section properties token into PHP code
File
- includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php, line 1834
Class
- Smarty_Compiler
- Template compiling class @package Smarty
Code
function _parse_conf_var($conf_var_expr) {
$parts = explode('|', $conf_var_expr, 2);
$var_ref = $parts[0];
$modifiers = isset($parts[1]) ? $parts[1] : '';
$var_name = substr($var_ref, 1, -1);
$output = "\$this->_config[0]['vars']['{$var_name}']";
$this
->_parse_modifiers($output, $modifiers);
return $output;
}