Welcome Guest, Not a member yet? Register   Sign In
CI Forum - get_where function for forum and topics
#21

Yes @PaulD , exacly Big Grin i just tried out this before 2 days. But then im struggling past that. Should i do foreach and then another foreach inside in the controller and return data to the view, or do it in the view itself? Following MVC i feel like the view should have only the final data?

Can you show me how to do that?
Reply
#22

bump bump
Reply
#23

Categories and forums someone?
Reply
#24

Is there ever a case where you don't display all forums and categories? I wouldn't think so ...

Just fetch all categories first, then fetch all forums and at that point it's just mapping elements between 2 arrays.
Reply
#25

(01-02-2018, 07:21 PM)Knightwalker Wrote: Yes @PaulD , exacly Big Grin i just tried out this before 2 days. But then im struggling past that. Should i do foreach and then another foreach inside in the controller and return data to the view, or do it in the view itself? Following MVC i feel like the view should have only the final data?

Can you show me how to do that?

Sorry, been busy. Jan is always a nightmare.

Narfs previous post is a good solution too, you could do the array matching in your controller (or library or model) and prepare the data however you need for a nice clean view.

With the query that gathers but repeats the category data with all the forums in one query, you do end up with some logic in your views that some people do not like. As long as it is just display logic I see no problem with it in the view personally.

Where are you now with this issue - have you got it resolved? If not I can do some sample code for you if it will help.

Best wishes,

Paul.
Reply
#26

Hi PaulD thank you for your time,

No i did not had time to look into it, because i had to work. I will be getting back at CodeIgniter learning real soon, because my PHP classes are starting again. Anyway here is a live example of what i want to achieve in CI. This will be life for maybe a few days.

http://cpanel.flatrockcomm.net/GOT/community.php

Basically i can do it without a framework, but i want to learn CI and the OOP way of doing things. I hope you can understand me and show me the way Big Grin

Best Regards,
Reply




Theme © iAndrew 2016 - Forum software by © MyBB