CodeIgniter Forums
Dynamic menu with template - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Dynamic menu with template (/showthread.php?tid=80590)



Dynamic menu with template - pippuccio76 - 11-18-2021

Hi , this is my layout :

Code:
<?= $this->include('templates/header_admin') ?>

<?= $this->renderSection('custom_css') ?>

<?= $this->include('templates/menu_admin') ?>

<?= $this->renderSection('content') ?>
   
<?= $this->include('templates/footer_admin') ?>

<?= $this->renderSection('script') ?>

<?= $this->include('templates/end_html') ?>
 

I want insert a method called for every page (menu is the same for every controllers) , where put i the method to be accessible for every  view ?


RE: Dynamic menu with template - InsiteFX - 11-19-2021

The method should be placed in the menu view that the layout loads.


RE: Dynamic menu with template - pippuccio76 - 11-19-2021

Sorry but method can be only on controller It Is true ?


RE: Dynamic menu with template - MGatner - 11-21-2021

Quick self-plug for my dynamic menus library: https://github.com/tattersoftware/codeigniter4-menus