I need some help with my php code. This is my code
class myclass extends anotherclass {
var $bAlert;
function myclass($var) {
parent::anotherclass($var);
$this->bAlert = false;
}
function alert() {
$this->bAlert = 'true';
return;
}
function display() {
if(!$this->bAlert) {
return;
}
return 'blah blah';
}
}
Now what i want, I have a function to show something on screen when display() is called thats not the problem but i only want it to show up after alert() is called. So here is what i thought but it has a problem. I want to permanently change the value of $bAlert to true once alert() is called and of course it doesn't happen. So, anybody got any other bright ideas or any other way to do it?
Thanks