Welcome Guest, Not a member yet? Register   Sign In
CI 3 should has partial view or user control
#8

(02-10-2015, 06:40 PM)iamybj Wrote:
(02-09-2015, 01:41 PM)CroNiX Wrote: Glad it helps. The example is very, very basic. I have a lot of different methods in my template library, like for generating admin pages vs. public pages, and it autogenerates the menu in my header file based on the logged in users session data to display links appropriate to that users' level, etc. I also pass an array of other things that need to go in the header file for my sites, like meta keywords, meta description, page title, etc, that go in the <head>.

plz note that , template is not enough.
Template is just a solution of sharing same part in view.
But some times, shared header\footer\sidebar have business logic too.
So the best method is nested a mvc into another mvc.

Sure, all my business logic for the header, and other partial views, gets generated in the template library. As I mentioned they're dynamic and get generated based on the users level and other factors. What you describe can easily be done without "mvc into another mvc". Sure you can use HMVC as well, but I've never needed to.
Reply


Messages In This Thread
RE: CI 3 should has partial view or user control - by CroNiX - 02-11-2015, 07:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB