Parse HTML content in CodeIgniter 4 |
I'm using Codeigniter 4.
PHP Code: $template = 'Hello, {firstname} {lastname}'; This is producing, ![]() But adding htmlspecialchars_decode() with this is working properly. PHP Code: echo htmlspecialchars_decode($parser->setData($data)->renderString($template)); ![]() My question is, is it the right way? Why I need to add this raw function? Is there any parameter or something for this? This was working in CI3. Thanks in advance.
As far as I see on the documentation page, html tags are used within views documentation page
It would make more sense to put the h1 tags in the template, not in the data array, and I think you wouldn't have this problem.
PHP Code: $template = 'Hello, <h1>{firstname}</h1> {lastname}'; |
Welcome Guest, Not a member yet? Register Sign In |