Location: PHPKode > scripts > OPC Data Grid > example.php
<?php 
include('OPCDataGrid.php');
$data = array(
	array(
		'uid' => 0,
		'username' => 'vaderd',
		'f_name' => 'Darth',
		'l_name' => 'Vader',
		'email' => 'hide@address.com'
	),
	array(
		'uid' => 1,
		'username' => 'skywalkl',
		'f_name' => 'Luke',
		'l_name' => 'Skywalker',
		'email' => 'hide@address.com'
	),
	array(
		'uid' => 3,
		'username' => 'organal',
		'f_name' => 'Leia',
		'l_name' => 'Organa',
		'email' => 'hide@address.com'
	),
	array(
		'uid' => 4,
		'username' => 'kenobio',
		'f_name' => 'Obi-Wan',
		'l_name' => 'Kenobi',
		'email' => 'hide@address.com'
	),
);

$dg = new OPCDataGrid(); 
$dg->source($data);
$dg->fields(array(
				'username' => 'Username',
				'email' => 'Email Address'
			));
$dg->addField('Full Name', 'full_name', '{f_name} {l_name}', array('before'=>'username')); 
$dg->render();
?>
Return current item: OPC Data Grid