Welcome Guest, Not a member yet? Register   Sign In
Best way create layouts library vs extend CI_Controller
#3

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.
Reply


Messages In This Thread
RE: Best way create layouts library vs extend CI_Controller - by kilishan - 01-06-2019, 12:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB