Example #1
0
$john = new Person('Waiter', 'John', 'Smith', '*****@*****.**');
$mary = new Person('Realtor', 'Mary', 'Smith', '*****@*****.**');
$tony = new Person('Teacher', 'Tony', 'Hawk', '*****@*****.**');
$johnny = new Person('Unemployed', 'Johnny', 'Appleseed', '*****@*****.**');
$people = array($john, $mary, $tony, $johnny);
// Testing
$obj = new Page("Homepage");
$obj->createHeader();
$obj->createContent("Header");
echo '<hr>';
$obj->createParagraph("This is a sample paragraph.");
echo '<hr>';
$obj->createLink("http://www.w3schools.com", "W3Schools");
//$obj->createTable("Table", "Content");
echo '<hr>';
$obj->createHeading('h1', 'This is a heading - h1');
$obj->createHeading('h2', 'This is a heading - h2');
$obj->createHeading('h3', 'This is a heading - h3');
echo '<hr>';
$obj->createForm($inputFields, 'index2.php');
echo '<hr>';
// Create table
echo '<h3>createTable($people) function</h3>';
createTable($people);
echo '<h3>createTable_v2($people) function</h3>';
createTable_v2($people);
echo '<h3>createTable_v2($cars) function</h3>';
createTable_v2($cars);
echo '<hr>';
$obj->setFooter("Footer - Tomasz Goralczyk");
$obj->createFooter();