Creating foreach loops using Code Igniter controller and view

前端 未结 4 1746
一整个雨季
一整个雨季 2021-01-17 02:35

This is a situation I have found myself in a few times and I just want clear it up once and for all.

Best just to show you what I need to do in some example code.

4条回答
  •  轮回少年
    2021-01-17 02:56

    As far as I know, there's not really a way to pass data back to the controller from the view. I myself have not ever felt the need to. Your controller should be gathering the data and then passing it to the view. If you have additional data to get from your database results, do that first and then pass it to your view along with the original data.

    Maybe I'm not understanding your question though...

提交回复
热议问题