Welcome Guest, Not a member yet? Register   Sign In
How to call controller from view without form submission ?
#8

(09-01-2017, 08:12 AM)Kaosweaver Wrote: Since this is a menu (from what I gather), if I were to put it in the controller (which I agree is where it belongs, strictly speaking) - I would create a MY_Controller, put it there and then have all of the other controllers inherit it.  This way, the menu system isn't being put everywhere and you've got one isolated location for it.
The code to create all of the data (as I'm assuming dynamic menus that change here) is also a little annoying to do without incorporating some view stuff in the controller, you have to create the loop, then get the view for the menu and its sub items, then merge them all, then pass to the final view.  Seemed like a lot of extra work for the exact same result with no real life benefit, which is why I recommended what I did.


Thanks for reply. Is there any way to do like i have my leftsidebar_contolle,leftsidebar _model and leftsidebar _view so i can load them once and use in application. like other controller,model,views we use.
Reply


Messages In This Thread
RE: How to call controller from view without form submission ? - by ktmonty - 09-04-2017, 02:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB