dynamic array issue in class
Posted: Fri Nov 20, 2009 5:04 am
Hi Everyone,
I have just started to teach myself oop in php and may have no chosen a good example to start with.
what i want to do is be able to generate navigation tabs for my website by doing something similar to the following
$tabs->newtab("Tab Name","Tab index");
$tabs->newtab("Tab Name","Tab index");
$tabs->newtab("Tab Name","Tab index");
$tabs->draw();
by invoking the tab draw this should draw the tab table,
with every newtab i would be thinking that this would put the data into a form of array within the class
I have tried every combination i can think of but just cant seem to work it out, get thrown heaps of errors, ive tried googling and searching forums but not 100% sure what im trying to look for, if someone can point me in the right direction that would be great, in general just want to know how to add an item to an array in a class
thanks all
I have just started to teach myself oop in php and may have no chosen a good example to start with.
what i want to do is be able to generate navigation tabs for my website by doing something similar to the following
$tabs->newtab("Tab Name","Tab index");
$tabs->newtab("Tab Name","Tab index");
$tabs->newtab("Tab Name","Tab index");
$tabs->draw();
by invoking the tab draw this should draw the tab table,
with every newtab i would be thinking that this would put the data into a form of array within the class
I have tried every combination i can think of but just cant seem to work it out, get thrown heaps of errors, ive tried googling and searching forums but not 100% sure what im trying to look for, if someone can point me in the right direction that would be great, in general just want to know how to add an item to an array in a class
thanks all