PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Using DataGrid Render() doesn't return anything

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR
View previous topic :: View next topic  
Author Message
mtgna



Joined: 01 Jun 2008
Posts: 5

PostPosted: Sun Jun 01, 2008 4:57 pm    Post subject: Using DataGrid Render() doesn't return anything Reply with quote

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' => '[email protected]'),
array('First Name' => 'Clark',
'Last Name' => 'Kent',
'Email' => '[email protected]'),
array('First Name' => 'Peter',
'Last Name' => 'Parker',
'Email' => '[email protected]'),
array('First Name' => 'Bruce',
'Last Name' => 'Wayne',
'Email' => '[email protected]')
);
$dg =& new Structures_DataGrid;
$dg->bind($data);
$dg->render();

?>
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Sun Jun 01, 2008 6:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
mtgna



Joined: 01 Jun 2008
Posts: 5

PostPosted: Mon Jun 02, 2008 3:47 am    Post subject: Reply with quote

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
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Mon Jun 02, 2008 7:29 am    Post subject: Reply with quote

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
View user's profile Send private message
mtgna



Joined: 01 Jun 2008
Posts: 5

PostPosted: Tue Jun 03, 2008 1:06 pm    Post subject: Reply with quote

You are exactly right.
However, the part about unknown driver still remains.
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Tue Jun 03, 2008 1:35 pm    Post subject: Reply with quote

mtgna wrote:
However, the part about unknown driver still remains.


Well, I already pointed you to the installation page:
http://pear.php.net/manual/en/package.structures.structures-datagrid.installation.php

And also make sure that your include_path setting is correct.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement