fahad ashraf
Well-known member
Hello,
is there any way to override default xenforo's phrase function
Thanks
is there any way to override default xenforo's phrase function
Thanks
src/XF/Template/Compiler/Func/Phrase.php.As I have just explained, it simply isn’t possible.
namespace My\Addon;
class Listener
{
public static function appSetup(\XF\App $app)
{
$app->container()->extend('templateCompiler'] = function(\XF\Template\Compiler $compiler)
{
$compiler->setFunction('phrase', '\\My\\Addon\\Template\\Compiler\\Fn\\Phrase');
return $compiler;
});
}
}
// We do not recommend trying to extend this class or the tags/functions it defines. Doing so may interfere
// with the upgrade process. If you must do so, it should not be part of an add-on. It should be done
// unconditionally via config.php. However, do so at your own peril as the worst case would potentially be
// an un-upgradeable installation.
We use essential cookies to make this site work, and optional cookies to enhance your experience.