![]() |
Render layout and access variables - 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: Render layout and access variables (/showthread.php?tid=87279) |
Render layout and access variables - jcarvalho - 04-03-2023 Hi guys, very new in CI4 (2 days) but long time user in CI3... I am struggling for some days using layout funcionality. Cant render the layout completely and cant access to settings variable defined in main.php that is the template. in this case, I cant see lista.php when the template is rendered on screen but no error. If I try to access $settings inside lista.php or boda.php I have an error saying that $settings is not defined, strange because all extends main.php Can someone point me what I am doing wrong? Thanks! Jorge My controller is like Code: public function index() PHP Code: <!DOCTYPE html> PHP Code: <?=$this->extend('layouts/main')?> PHP Code: <?=$this->extend('layouts/main')?> |