function Smarty_Compiler::_compile_plugin_call in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/lib/smarty/Smarty_Compiler.class.php \Smarty_Compiler::_compile_plugin_call()
compiles call to plugin of type $type with name $name returns a string containing the function-name or method call without the paramter-list that would have follow to make the call valid php-syntax
Parameters
string $type:
string $name:
Return value
string
3 calls to Smarty_Compiler::_compile_plugin_call()
- Smarty_Compiler::_compile_block_tag in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - compile block function tag
- Smarty_Compiler::_compile_custom_tag in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - compile custom function tag
- Smarty_Compiler::_parse_modifiers in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - parse modifier chain into PHP code
File
- includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php, line 2124
Class
- Smarty_Compiler
- Template compiling class @package Smarty
Code
function _compile_plugin_call($type, $name) {
if (isset($this->_plugins[$type][$name])) {
/* plugin loaded */
if (is_array($this->_plugins[$type][$name][0])) {
return (is_object($this->_plugins[$type][$name][0][0]) ? "\$this->_plugins['{$type}']['{$name}'][0][0]->" : (string) $this->_plugins[$type][$name][0][0] . '::') . $this->_plugins[$type][$name][0][1];
}
else {
/* function callback */
return $this->_plugins[$type][$name][0];
}
}
else {
/* plugin not loaded -> auto-loadable-plugin */
return 'smarty_' . $type . '_' . $name;
}
}