This xHTML-o-MATIC is aimed to provide an OO way to handle, simplify and split the logic process for creating and maintaining a PHP web frontend.
By using this mini framework, you can easily split HTML logic and structure in your code, making your whole project more readable with less HTML embedded to its PHP part while having a powerfull DOM-Like tree for handling the nodes you want.
Usage Example
<?php
require_once '/xHTML_All.php';
$webPage->AddCSSFile("some-css-file.css");
$header->SetID("header");
$footer->SetID("footer");
$contentMainDiv->SetID("content");
$webPage->AddContent($header);
$webPage->AddContent($footer);
$footer->AddContentBefore($contentMainDiv);
$contentMainDiv->AddContent(
new xHTML_P(
"Welcome to the xHTML-o-MATIC test page!"));
$contentMainDiv->AddContent(
new xHTML_UnparsedCode(
"<p>And also, it allows to add unparsed code by hand like this <a href='http://www.google.es'>google link</a> inside a p element</p>"));
$table->SetProperty("align", "center");
$table->SetProperty("border", "1");
$table->SetProperty("width", "60%");
$table->AddContentMatrix(0, 0,
new xHTML_P(
"This is cell 0,0"));
$table->AddContentMatrix(0, 1,
new xHTML_P(
"This is cell 0,1"));
$table->AddContentMatrix(1, 1, "This is cell 1,1");
$table->SetCellProperty(1, 1, "align", "right");
$webPage->AddContent($table);
$webPage->Render();
?>
Definition xHTML_Div.php:12
Definition xHTML_P.php:13
Definition xHTML_Page.php:12
Definition xHTML_Table.php:12
Definition xHTML_UnparsedCode.php:12