For a long time in the Java/JSP world I used to use the Display Tag library to generate a table that would allow you to sort a table, and export the table as a CSV file.
Is there anything like this in a PHP library that I could use?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer, from my searching, appears to be no. I wanted one too–love displaytag.
If you want a php only solution, Structures_DataGrid seems to be the best solution. Here’s an article about it. This handles paging and sorting, but no exporting. Not sure how supported it is, either.
Another answer appears to be to use javascript to do paging and sorting, and roll your own php export functionality.
The state of the web is significantly different than it was when displaytag was created (ie, AJAX supported with a rich toolset), so I’m not sure there ever will be a full replacement. Why do sorting and paging with a call to the server when you can do it on the client?
Here’s a jquery plugin that supports paging and sorting, and here’s another one–all you need to do is have your php generate the table correctly.
As far as CSV exporting, there are tons of snippets out there. Here’s one that looked good to me.