Welcome Guest, Not a member yet? Register   Sign In
How to disassemble html skills?
#3

(08-29-2019, 09:19 PM)ciadmin Wrote: One possibility is to use the View Parser (https://codeigniter4.github.io/userguide...arser.html)

Build your view as
Code:
<body>
<section></section>
{codeGoesHere}
<section></section>
...
Build your code to go in the middle, and assign it to something, eg $whateverYouSavedYourRealBodyAs,
and then render the view with the nested content:

Code:
$parser = \Config\Services::parser();
$parser->setData(['codeGoesHere' => $whateverYouSavedYourRealBodyAs])
             ->render('theTemplateWithTheFragmentShownAbove');

This technique is used in the CodeIgniter website (CI4 version being published very soon).

So great!
Reply


Messages In This Thread
How to disassemble html skills? - by rfrkk - 08-29-2019, 07:09 PM
RE: How to disassemble html skills? - by ciadmin - 08-29-2019, 09:19 PM
RE: How to disassemble html skills? - by rfrkk - 08-30-2019, 05:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB