The following files exists in this folder. Click to view.
human.php1 lines UTF-8 Unix (LF) <?php
/**
* This is a Anax pagecontroller.
*
*/
// Include the essential config-file which also creates the $anax variable with its defaults.
include(__DIR__.'/config.php');
//include('../src/CHuman/CHuman.php');
$mikael = new CHuman("Mikael Roos", 46, "Webbprogrammer");
$jane = new CHuman("Jane Strandberg", 24, "Webprogrammer");
$mumin = new CSuperHuman("Mumintrollet", 15, "Skådespelare", "dansa");
//$mikael->name = "Mikael Mumin";
//$mikael = null;
//$html = $mikael->description();
$html = $mikael->descriptionAsHtml();
$html .= $jane->descriptionAsHtml();
$html .= $mumin->about();
/*
$mikael->name = "Mikael Roos";
$mikael->age = 46;
$mikael->profession = "Webprogrammer";
$jane->name = "Jane Strandberg";
$jane->age = 24;
$jane->profession = "Webprogrammer";
$html = $mikael->descriptionAsHtml();
$html .= $jane->descriptionAsHtml();
//$html = $mikael->descriptionAsHtml($name, $age, $profession);
//$html .= $jane->descriptionAsHtml($name1, $age1, $profession1);
/*
$name = "Mikael Roos";
$age = 46;
$profession = "Webprogrammer";
$name1 = "Jane Strandberg";
$age1 = 24;
$profession1 = "Webprogrammer";
/*
function description($name, $age, $profession) {
//global $name;
return "My name is $name, I'm $age old and work as a $profession.";
}
function descriptionAsHtml($name, $age, $profession) {
//global $name;
return "<p>" . description($name, $age, $profession) . "</p>";
}
*/
// Do it and store it all in variables in the Anax container.
$anax['title'] = "Human objects";
$anax['main'] = <<<EOD
<h1>Humans as object</h1>
{$html}
EOD;
// Finally, leave it all to the rendering phase of Anax.
include(ANAX_THEME_PATH);