View sourcecode

The following files exists in this folder. Click to view.

human.php

1 lines ASCII Unix (LF)
1
<?php 
/**
 * This is a Anax pagecontroller.
 *
 */
// Include the essential config-file which also creates the $anax variable with its defaults.
include(__DIR__.'/config.php'); 

$mikael = new CHuman();
$jane = new CHuman();

/*
$age = 46;
$name = "Mikael Roos";
$profession = "Webprogrammer";

$age1 = 24;
$name1 = "Jane Strandberg";
$profession1 = "Webprogrammer";

/*
function description($name, $age, $profession) {
    return "$name is a $age old $profession.";
}

function descriptionAsHtml($name, $age, $profession) {
    return "<p>" . description($name, $age, $profession) . "</p>";
}
*/

$html = $mikael->descriptionAsHtml($name, $age, $profession);
$html .= $jane->descriptionAsHtml($name1, $age1, $profession1);


$human1 = new CHuman();

$human1->name = "Mikael Roos";

$html .= $human1->description();



// Do it and store it all in variables in the Anax container.
$anax['title'] = "Human";

$anax['main'] = <<<EOD
<h1>Human</h1>
{$html}
EOD;



// Finally, leave it all to the rendering phase of Anax.
include(ANAX_THEME_PATH);