XF 2.1 Showing html as string

fahad ashraf

Well-known member
Hello ,

I made a template function on listener and returning html from that function but it is showing as string not html below in my code

PHP:
    public static function templaterSetup(Container $container, Templater &$templater) {
        $templater->addFunction('star_rank', [__CLASS__, 'templaterFnStarRank']);
    }

    
    public static function templaterFnStarRank(
        $templater, &$escape, \XF\Entity\User $user
    )
    {
        return "<div></div>";
    }

it is showing as please see below image

Screenshot from 2020-03-31 01-17-54.webp


Anybody please help me to solve this issue

Thanks
 
Back
Top Bottom