CodeIgniter Forums
Is extending views possible? - 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: Is extending views possible? (/showthread.php?tid=77478)



Is extending views possible? - futureisnow - 09-06-2020

Hi,
is it possible to extend a view in CI4? I mean I have 2 controller classes (one extending another) and 2 views corresponding to the controllers. The difference between the views is only a minimal and I would be nice to avoid repeating the code of the views somehow. Unfortunately I didn't find if and how can be done. 
The only idea I have is using the same view and manipulating with variables but maybe there is a more elegant solution. Any advice?


RE: Is extending views possible? - InsiteFX - 09-06-2020

Check out view layouts in the CodeIgniter User Guide

CodeIgniter User Guide - View Layouts