<?php
/* project: Basic grid, file: basicgrid.php */
//Include pclib framework
require 'pclib/pclib.php';
//Create pclib application
$app = new PCApp('demo');
$datasource = 'pdo_mysql://user:password@localhost/test';
//Connect to database and register it as $app->db
$app->db = new PCDb($datasource);
//Initialize grid template, set grid query and write grid out
$grid = new PCGrid('tpl/basicgrid.tpl');
$grid->setQuery('select * from PRODUCTS');
//You can put additional values into grid template
$grid->values['TITLE'] = 'Basic features of the grid';
//Show the grid! Also functions $grid->out() and $grid->html() can be used.
print $grid;
?>
Elapsed time: 24.27 ms