CodeIgniter: Load controller within controller

后端 未结 10 1754
余生分开走
余生分开走 2020-11-28 07:43

I have a home controller with an index action that displays a set of featured products. However, the products are managed through a product

10条回答
  •  甜味超标
    2020-11-28 08:39

    I know this is old, but should anyone find it more recently, I would suggest creating a separate class file in the controllers folder. Pass in the existing controller object into the class constructor and then you can access the functions from anywhere and it doesn't conflict with CI's setup and handling.

提交回复
热议问题