About layout creation with renderSection |
For the more experienced ...
Is it worth using "renderSection()" instead of just "echo view()"? https://codeigniter4.github.io/CodeIgnit...youts.html
It makes more sense to use a template with renderSection() and echoing only one view in the controller than having to echoing a view for the header, then your content, then the footer, etc.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Is it possible to cache the layout? Example: cache($this->extend('layouts/layout_site'))
<?= $this->extend('layouts/layout_site') ?> <?= $this->section('content') ?> <h1>Hello World!</h1> <?= $this->endSection() ?>
You can cache the whole page with $this->cachePage($n);
https://codeigniter4.github.io/userguide...ching.html
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |