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

(This post was last modified: 08-21-2020, 01:19 PM by jreklund.)

(08-16-2020, 08:17 AM)InsiteFX Wrote: 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.

Unfortunately it doesn't. And this impossibility is really demotivating ...
It seems very obvious that both features can work together as it is in Laravel ...
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 aleckyann - 08-21-2020, 06:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB