Introduction
This page explains how to setup and use a simple view controller module within the Antares framework environment. This example uses a preexisting HTML template in order to populate the desired areas with contents.
Details
This example loads in an existing HTML template, and populates a desired element with a table that has two rows with two columns.
HTML Template
This template should exist within the 'view' directory within the base of the framework environment. In this example, we're assuming the name of this file is ''template.html''.
<html>
<head>
<title>Antares Example</title>
</head>
<body>
<div id='Contents'>
</div>
</body>
</html>
Module Code
This example assumes that you know how to [wiki:ModuleCreation Create a Module].
<?php
$view = Control::getView();
$view->loadTemplate(htmlDir.'template.html');
$contents = $view->getPathFirst('div', 'id', 'Contents');
$dataTable = $contents->table();
$rowOne = $dataTable->tr();
$rowTwo = $dataTable->tr();
$rowOne->td()->span('One');
$rowOne->td()->span('One');
$rowTwo->td()->span('Two');
$rowTwo->td()->span('Two');
?>
i like the concept behind the Antares.