php within a class referencing?

Namibnat

New member
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 from another within the class.

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?
 
Back
Top