LIttle of topic. I got this code from php manual.
<?php
class mainClass
{
/*
* Class loading function.
*
*
*
*
*/
var $module;
function LoadClass($loadModule)
{
$this->module = new $loadModule; // this is much better
}
function RunFunction($FunctionName)
{
$this->module->$FunctionName();
}
function ListFunctions()
{
}
// function out()
//{
// $this->module->out();
// }
}
class subclass
{
function out()
{
echo "Worked";
}
function NewFunction()
{
echo "<br>Good Lord<br>";
}
function ThirdFunction()
{
echo "<br>eh....<br>";
}
}
echo "Start of class manulapations<br>";
//$loadModule = new subclass;
$mainclass=new mainClass;
$mainclass->LoadClass("subclass");
//$mainclass->out();
$mainclass->RunFunction('NewFunction');
//$mainclass->ThirdFunction();
echo "End of class manulapation<br>";
?>
*******
I don't understand what he is doing in first function
$this->module = new $loadModule; // this is much
and second function
$this->module->$FunctionName();
<?php
class mainClass
{
/*
* Class loading function.
*
*
*
*
*/
var $module;
function LoadClass($loadModule)
{
$this->module = new $loadModule; // this is much better
}
function RunFunction($FunctionName)
{
$this->module->$FunctionName();
}
function ListFunctions()
{
}
// function out()
//{
// $this->module->out();
// }
}
class subclass
{
function out()
{
echo "Worked";
}
function NewFunction()
{
echo "<br>Good Lord<br>";
}
function ThirdFunction()
{
echo "<br>eh....<br>";
}
}
echo "Start of class manulapations<br>";
//$loadModule = new subclass;
$mainclass=new mainClass;
$mainclass->LoadClass("subclass");
//$mainclass->out();
$mainclass->RunFunction('NewFunction');
//$mainclass->ThirdFunction();
echo "End of class manulapation<br>";
?>
*******
I don't understand what he is doing in first function
$this->module = new $loadModule; // this is much
and second function
$this->module->$FunctionName();