Book Image

PHP Programming with PEAR

By : Carsten Lucke, Stoyan Stefanov
Book Image

PHP Programming with PEAR

By: Carsten Lucke, Stoyan Stefanov

Overview of this book

<p>PEAR is the PHP Extension and Application Repository, and is a framework and distribution system for reusable, high-quality PHP components, available in the form of "packages". <br /><br />In this book, you will learn how to use a number of the most powerful PEAR packages available to boost your PHP development productivity. By focusing on these packages for key development activities, this book is an in-depth guide to getting the most from these powerful coding resources.<br /><br />You will become a master of various PEAR packages that help you with the essential tasks of PHP development such as:<br /><br />•&nbsp;&nbsp;&nbsp; Accessing databases with MDB2<br />•&nbsp;&nbsp;&nbsp; Displaying data in a range of formats (HTML, Excel spreadsheet, PDF)<br />•&nbsp;&nbsp;&nbsp; Creating and parsing XML documents<br />•&nbsp;&nbsp;&nbsp; Serializing PHP objects into XML, and unserializing XML documents to PHP objects<br />•&nbsp;&nbsp;&nbsp; Consuming and offering web services<br />•&nbsp;&nbsp;&nbsp; Accessing Web APIs including Google, Yahoo, Amazon, and Technorati</p>
Table of Contents (10 chapters)

DataGrids


Windows programmers are familiar with the concept of using a DataGrid component to display data in a flexible and sortable grid. In simple scenarios, all a programmer needs is to pull data out of a DataSource (database, text file, array) and display it in an easily configurable HTML web page. In more complex scenarios a programmer will want to make the grid sortable, enable data filtering, and render it to multiple formats.

On the web front, ASP.NET programmers have a DataGrid component available to them. PHP has no standard implementation of the DataGrid, and most PHP programmers have had to write their own component or settle for a third-party component or commercial implementation.

As mentioned above, a DataGrid component requires several elements.

  • You need to get the data from somewhere; this is referred to as your DataSource.

  • You need to create your DataGrid and select an output format, which is referred to as the Renderer.

  • You need to bind the DataSource to the DataGrid...