Best way create layouts library vs extend CI_Controller |
In the past I've created a ThemedController that any controller could extends that provided a simple template system.
And, in CI4, I've even managed to extend the View library and provide some traditional template-like methods, including extending layouts, sections for dropping content into, etc. The secret sauce there is that you must remember when the views are rendered, they are in the scope of the View library that's rendering them. So you can add additional methods to your overridden class, and add whatever functionality you want. |
Messages In This Thread |
Best way create layouts library vs extend CI_Controller - by asalves - 01-06-2019, 03:43 AM
RE: Best way create layouts library vs extend CI_Controller - by natanfelles - 01-06-2019, 11:52 AM
RE: Best way create layouts library vs extend CI_Controller - by kilishan - 01-06-2019, 12:32 PM
|