Welcome Guest, Not a member yet? Register   Sign In
How to load partials with View Parser?
#2

Okay, I figured it myself.

I thought about this overnight and this morning I took a look in the source that was being generated (something I didn't think of last night when I started this thread). I realized that the parser was escaping the special characters turning < and > into &lt; and &gt respectively -- and that's why it was showing code as plain text instead to interpret it as HTML.

The solution was fairly simple. Just had to apply the htmlspecialchars_decode native function on parser var this way:

PHP Code:
return htmlspecialchars_decode($parser->setData($data)->render('produtos_testeForeach')); 

Maybe there is simpler ways of solving it (like setting some configuration in CI or so) but it fixed the issue for me!

Big Grin
Recovering the wasted time...
Reply


Messages In This Thread
RE: How to load partials with View Parser? - by YanKleber - 04-23-2020, 05:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB