You are here

function Smarty::register_function in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/smarty/Smarty.class.php \Smarty::register_function()

Registers custom function to be used in templates

Parameters

string $function the name of the template function:

string $function_impl the name of the PHP function to register:

File

includes/moodle/lib/smarty/Smarty.class.php, line 689

Class

Smarty
@package Smarty

Code

function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null) {
  $this->_plugins['function'][$function] = array(
    $function_impl,
    null,
    null,
    false,
    $cacheable,
    $cache_attrs,
  );
}