Welcome Guest, Not a member yet? Register   Sign In
How to use LayoutView with parser?
#5

The View Parser:

Using the Parser, in your view templates are processed only by the Parser itself, and not like a conventional view PHP script. PHP code in such a script is ignored by the parser, and only substitutions are performed.

This is purposeful: view files with no PHP.

So maybe it would work if you ran the Parser on the Layout using:


PHP Code:
$parser = \Config\Services::parser();

$newView $parser->setData($data)
             ->render('layout');

echo 
view($newView); 

I do not have the time to play with this but you may like to give it a try.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
How to use LayoutView with parser? - by aleckyann - 08-14-2020, 10:40 AM
RE: How to use LayoutView with parser? - by InsiteFX - 08-16-2020, 08:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB