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

(09-01-2017, 06:14 AM)Kaosweaver Wrote: What you really need is a model to load in your view so your menu can read the submenu items.
To do this you could just pull in the instance of CI, then call your model, then call the subquery:
PHP Code:
$this->_ci = &get_instance();
$this->_ci->load->model('Menu_model');

// inside your loop
$this->_ci->Menu_model->get_submenu($row->top_menu_id); 
Obviously, using your own model name, column names and function calls (since I didn't know them, I made mine up)

Hi Kaosweaver,
 
Thanks for your reply with code it helps. 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:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB