You are here

function Smarty::register_resource in Quiz 6.5

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

Registers a resource to fetch a template

Parameters

string $type name of resource:

array $functions array of functions to handle resource:

File

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

Class

Smarty
@package Smarty

Code

function register_resource($type, $functions) {
  if (count($functions) == 4) {
    $this->_plugins['resource'][$type] = array(
      $functions,
      false,
    );
  }
  elseif (count($functions) == 5) {
    $this->_plugins['resource'][$type] = array(
      array(
        array(
          &$functions[0],
          $functions[1],
        ),
        array(
          &$functions[0],
          $functions[2],
        ),
        array(
          &$functions[0],
          $functions[3],
        ),
        array(
          &$functions[0],
          $functions[4],
        ),
      ),
      false,
    );
  }
  else {
    $this
      ->trigger_error("malformed function-list for '{$type}' in register_resource");
  }
}