| View previous topic :: View next topic |
| Author |
Message |
mtgna
Joined: 01 Jun 2008 Posts: 5
|
Posted: Sun Jun 01, 2008 4:57 pm Post subject: Using DataGrid Render() doesn't return anything |
|
|
The following script doesn't generate any errors but returns a blank HTML page. Any ideas?
<?php
require_once 'Structures/DataGrid.php';
$data = array(array('First Name' => 'Aaron',
'Last Name' => 'Wormus',
'Email' => 'aaron@wormus.com'),
array('First Name' => 'Clark',
'Last Name' => 'Kent',
'Email' => 'clark@kent.com'),
array('First Name' => 'Peter',
'Last Name' => 'Parker',
'Email' => 'peter@parker.com'),
array('First Name' => 'Bruce',
'Last Name' => 'Wayne',
'Email' => 'bruce@wayne.com')
);
$dg =& new Structures_DataGrid;
$dg->bind($data);
$dg->render();
?> |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1003
|
Posted: Sun Jun 01, 2008 6:38 pm Post subject: |
|
|
Well, if you don't check for errors in your code, how do you expect to get error messages?
Anyway, insert the following lines at the beginning of your script and you should get one or more error messages:
| Code: |
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'PEAR.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
|
Most likely you haven't followed the installation tutorial for SDG in the manual, and one or more subpackages are missing. |
|
| Back to top |
|
 |
mtgna
Joined: 01 Jun 2008 Posts: 5
|
Posted: Mon Jun 02, 2008 3:47 am Post subject: |
|
|
Thanks for that.
Now I can see the error message as follows:
Notice: Use of undefined constant HTML_Table - assumed 'HTML_Table' in C:\Program Files\xampp\htdocs\excel.php on line 15
Unknown Renderer driver. Please specify an existing driver.
How can I fix this? |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1003
|
Posted: Mon Jun 02, 2008 7:29 am Post subject: |
|
|
| mtgna wrote: | Notice: Use of undefined constant HTML_Table - assumed 'HTML_Table' in C:\Program Files\xampp\htdocs\excel.php on line 15
Unknown Renderer driver. Please specify an existing driver. |
This notice can't be generated from the code that you've shown here.
I assume that you now do something like | Code: | | $dg->render(HTML_Table); | , right?
Correct would be one of the following lines:
| Code: |
$dg->render('HTML_Table');
$dg->render();
|
Using the HTML_Table output is the default output, and therefore, specifying its name isn't needed. |
|
| Back to top |
|
 |
mtgna
Joined: 01 Jun 2008 Posts: 5
|
Posted: Tue Jun 03, 2008 1:06 pm Post subject: |
|
|
You are exactly right.
However, the part about unknown driver still remains. |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1003
|
|
| Back to top |
|
 |
|