Does anyone know how to call a static util function inside {lang}?

  • For example something like that would work {15|rand:25} but {15|MathUtil::getRandomValue:25} would throw an error.

    Can any static function be passed directly and if not what's the alternative approach? The only thing I could think of would be writing a Template Plugin or implementing a class method 'ICompilerTemplatePlugin'. Any ideas?:/

  • Hello,

    You cannot call static functions from the template, after all it's meant for some simple business logic and is usually backed by corresponding PHP classes. Please note that both call_user_func() and call_user_func_array() are blacklisted in the compiler.

    Alexander Ebert
    Senior Developer WoltLab® GmbH