![]() |
View layout with two successive includes - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: View layout with two successive includes (/showthread.php?tid=75198) |
View layout with two successive includes - elyday - 01-09-2020 Hello, I am currently working on a project based on CI4 and have now reached the layout. For this I would like to use the flexible View Layout System from CI, but I think I just found an error. I use the following code to build the layout in a view: PHP Code: <?= $this->extend('layouts/main') ?> The layout looks like this: PHP Code: <!DOCTYPE html> In the respective Includes I assemble the Sections. PHP Code: <?= $this->section('sidebar') ?> PHP Code: <?= $this->section('topbar') ?> Now I have the problem that I only get the first include of both, but never both at the same time. Does anyone know this problem or have a solution for it? RE: View layout with two successive includes - php_rocs - 01-10-2020 @elyday, This should be in the CI4 Support section. Hopefully one of the admins will move it for you. RE: View layout with two successive includes - InsiteFX - 01-10-2020 You can still use echo view in the layout PHP Code: <?= view('includes/topbar') ?> Try that, that's how it is done in the Myth/Auth layout. Also if you look at the include it is placed between the section and endSection. PHP Code: <?= $this->extend('default') ?> |