[eluser]ROFLwtfBBQ?[/eluser]
Ok a design pattern question here. I'm using active record to fetch all the data from a table: 'categories'. Under each category, i want to list sub-categories (all of them in the same view). I figured the best way to do this was to add another Query inside the View in the 'categories' for each loop, because the sub-categories listing has to know the specific category_id in order to know what category it should be listed under. I'd rather do all of the queries in the model or controller, but i can't send data (for example category_id) back to the controller? So is there a better way to solve this than the way im currently doing it. Any ideas? My current solution kind of screams bad practice, since i want to seperate my php code from the view as much as possible.