I recently decided to upgrade to PHP 5, and wiith all the new ))) features I thought it was time to rewrite some of my existing code. However I've ran into a problem when inherting (exttending) a class from a base class.
I define my base class:
Code: Select all
class TForm
{
public $Name;
function __construct($name)
{
$this->Name = $name;
}
function createControls()
{
$TextBox1 = "Hello World";
}
}Code: Select all
class TForm_NewStaff
{
public $TextBox1;
}I have simplified my classes for clarity, the problem I am having is that the child class define additional public variables, such as $TextBox1. The child class also inherits the function createControls(). I require the function createControl() in the base class to have access to $TextBox.. I would therefore try something like this in my code.
Code: Select all
$frm_NewStaff = TForm_NewStaff
$frm_NewStaff->createControls();But naturally, I cannot get this to happen! Is it possible?
Thanks
Musaffar Patel