I am sorry to ask such a beginner question:
I am just learning to use classes and objects in php and would like to know one simple thing - how to you reference one function (or should I call them methods?) from another within the class. When I specify a return value, it gives me an error?
For example:
class buttons{
function draw(){
echo "<input type="button" style='height:" . $size[height] . "; width:" . size[width] . ";' name='button' value='press' />"
}
function size(h, w){
$size[height] = h . 'px';
$size[width] = w . 'px';
}
bringButton(h, w){
size(h, w);
draw();
}
}
$LinkHome = new buttons;
$LinkHome->bringButtons();
I know you probably wouldn't do it like this in this case, but if you were to have three functions like that, how to you set the one and call the other.
Where does the $this come in?
Most of the tutorials go to great length about explaining about how objects are created from classes and so on, but seem rather vague about the mechanics of the classes themselves. I also couldn't get a clear answer from looking through the classes/objects manual pages.