My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ExampleVCModule  
This page details how to create a view controller module within Antares.
Updated Jun 29, 2009 by joshbb...@gmail.com

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');

?>
Comment by indika.g...@gmail.com, May 9, 2011

i like the concept behind the Antares.


Sign in to add a comment
Powered by Google Project Hosting