[eluser]Random dude[/eluser]
I'm fairly new to php, and I'm wondering how I can gather this particular set of data as a single $variable in a Model, and then pass it to a view.
I have
categories, and each category has
items within it. items have "id" and "title" feilds.
In my view I want to print:
category 1
item_id item_title
item_id item_title
item_id item_title
item_id item_title
category 2
item_id item_title
item_id item_title
item_id item_title
item_id item_title
category 3
item_id item_title
item_id item_title
item_id item_title
item_id item_title
etc.
My first try was a multidimensional array
$array[ $category_name ] = array ( $item_id => $item_title, $item_id => $item_title ....)
and repeat.
So in the view I can:
echo $category_name;
echo $item_id echo $item_title
echo $item_id echo $item_title
What do you think?
Current state of affairs is I can even get my code to compile!