Welcome Guest, Not a member yet? Register   Sign In
Using objects without instantiating them by default
#1

[eluser]mddd[/eluser]
I am building some applications which use lists of items. I want to use a structure where the list itself is represented by an object, and each item is also an object. So I would make a new list with $list = new List; and that would have a property $list->items containing an array of objects, each created by $item = new Item;

My question is, what is the best way to do this in the CI framework. Making 'list' and 'item' models, they would always be loaded if I declare them in a contructor in my controller. So I would have an 'extra' list object and item object 'hanging around'.

What would be the cleanest way to do something like this?




Theme © iAndrew 2016 - Forum software by © MyBB