Class Constructs

Within The EssenceOne Controllers 

Using Class and Class Constructs Too Build Dynamic Module Controllers.

Using classes helps to wrap everything within our scripts within it's own tite little package. This allows variables to be privately controlled within their own confines or Modules. In EssenceOne we use these entirely for adding modules within the Framework for controllers fo each new module we wish to create. Very simple they are Logically. There are two types shown below.
//The difference between normal class methods and construct class methods//

class exampleOne
{
function sayHello()
{
echo 'Hello !';
}//end function
}//end class
//now to execute our class
$ourexample = new exampleOne;
$ourexample->sayHello();

class exampleTwo
{
public function __construct()
{
$this->sayHowdy();
}//end function construct

public function sayHowdy()
{
echo 'Howdy !';
}//end function
}//end class
// now we can call and execute the class using only one line below//
$example = new exampleTwo;

No comments:

Post a Comment