• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.