3.1.23. registerFunction()

void registerFunction ( mixed $name [, string $callback] )

Registers new function in the parser. Depending on the number of parameters:

  1. The method takes an assotiative array as the first parameter, which contains pairs name => callback. "name" means the name, under which we want to see the function in the template. "callback" is a PHP function callback (without the "opt" prefix!). This allows to register many functions at once.
  2. The method takes the name as the first parameter and the callback as the second one.

The registered function must have an "opt" prefix in the name and take an optClass object as the first parameter.

Note: this method is not available, if the Register method family was removed from the source with OPT Configurator.