How to call codeigniter controller function from view

后端 未结 14 1783
小蘑菇
小蘑菇 2020-11-27 05:53

How to call codeigniter controller function from view? When i call the function in a controller, get a 404 page.

14条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 06:37

    if you need to call a controller from a view, maybe to load a partial view, you thinking as modular programming, and you should implement HMVC structure in lieu of plane MVC. CodeIgniter didnt implement HMVC natively, but you can use this useful library in order to implement HMVC. https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

    after setup remember:that all your controllers should extends from MX_Controller in order to using this feature.

提交回复
热议问题