cvs: peardoc /en/package/structures/structures-datagrid/structures-datagrid bindDataSource.xml

From: Date: Fri, 10 Dec 2004 19:59:36 +0000
Subject: cvs: peardoc /en/package/structures/structures-datagrid/structures-datagrid bindDataSource.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5261@lists.php.net to get a copy of this message
asnagy Fri Dec 10 14:59:36 2004 EDT Modified files: /peardoc/en/package/structures/structures-datagrid/structures-datagrid bindDataSource.xml Log: Added example http://cvs.php.net/diff.php/peardoc/en/package/structures/structures-datagrid/structures-datagrid/bindDataSource.xml?r1=1.4&r2=1.5&ty=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/bindDataSource.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid/bindDataSource.xml:1.4 peardoc/en/package/structures/structures-datagrid/structures-datagrid/bindDataSource.xml:1.5 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid/bindDataSource.xml:1.4 Tue Nov 2 02:26:41 2004 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/bindDataSource.xml Fri Dec 10 14:59:36 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.structures.structures_datagrid.structures_datagrid.bindDataSource"> <refnamediv> @@ -46,9 +46,34 @@ <refsect1 id="package.structures.structures_datagrid.structures_datagrid.bindDataSource.return"> &title.returns; <para> - &type.mixed; - True upon success otherwise a &class.pear-error; upon failure + &type.mixed; - &true; upon success otherwise a &class.pear-error; upon failure </para> </refsect1> + + <refsect1 id="package.structures.structures_datagrid.structures_datagrid.bindDataSource.example"> + &title.example; + <example> + <title>Bind datagrid to a DB_Result Object</title> + <programlisting role="php"> + <![CDATA[ +<?php +require('Structures/DataGrid.php'); + +$dg = new Structures_DataGrid(); + +// Get my data +$result = $db->query('SELECT * FROM users'); + +// Bind to DataGrid +$data = Structures_DataGrid_DataSource::create($result); +$dg->bindDataSource($data); + +// Print the DataGrid +$dg->render(); +?> + ]]> + </programlisting> + </refentry>

« previous php.pear.doc (#5261) next »