Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Angelo Rodrigues  >  OPC Data Grid  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example usage
Class: OPC Data Grid
Display data listings in an HTML table
Author: By
Last change:
Date: 2010-10-11 13:25
Size: 898 bytes
 

Contents

Class file image Download
<?php 
include('OPCDataGrid.php');
$data = array(
    array(
        
'uid' => 0,
        
'username' => 'vaderd',
        
'f_name' => 'Darth',
        
'l_name' => 'Vader',
        
'email' => 'vaderd@deathstar.com'
    
),
    array(
        
'uid' => 1,
        
'username' => 'skywalkl',
        
'f_name' => 'Luke',
        
'l_name' => 'Skywalker',
        
'email' => 'wampasn1p3r@rebelalliance.org'
    
),
    array(
        
'uid' => 3,
        
'username' => 'organal',
        
'f_name' => 'Leia',
        
'l_name' => 'Organa',
        
'email' => 'BeautifulPrincess@rebelalliance.com'
    
),
    array(
        
'uid' => 4,
        
'username' => 'kenobio',
        
'f_name' => 'Obi-Wan',
        
'l_name' => 'Kenobi',
        
'email' => 'ben@jedi.ca'
    
),
);

$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();
?>