Step 1: setting up the enviroment
Create a file, we will call it "config.php", wich will initialize the framework.
We will also initialise the 2 cornerstones of the framework, being the database abstraction layer, or dbl for short and the Template engine or tpl if refered too.
| model/grades.class.php |
<?php
/* gives us the framework */
include('../zen-ng/zen.php');
/* set up the database connection */
/* import database abstraction layer & mysql driver */
zen::import('/core/dbl/db.class.php');
zen::import('/core/dbl/mysql.class.php');
/* register the instance of a mysql dbl object and "dbl" as callback
* for the zen-ng instance engine */
zen::register(new Mysql('localhost', 'root', '****', 'showcase'), 'dbl');
/* Set up the template engine, used for seperating model & layout */
zen::import('/core/tpl/tpl.class.php');
zen::register(new Template('main.tpl', './tpl/', zen::path().zen::tplPath, false));
?> |