Ci4 how to check if section exist with renderSection |
i need something like this:
PHP Code: if ( isset ( $this->renderSection('content')) {
You do not need to perform such a check by yourself.
In your layout file: PHP Code: <?= $this->renderSection('content') ?> In a view that uses 'content': PHP Code: <?= $this->section("content") ?> And in a view that uses 'default': PHP Code: <?= $this->section("default") ?> CodeIgniter Wizard (CRUD code generator for Mac) instantly scaffolds Bootstrap-based web applications with an administrative interface (admin templates include Bootstrap5)
If you have 2 different sections then you should have 2 different templates for each one.
Template1 - view1 // content Template2 - view2 // default What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |