cvs: peardoc /en/package/structures/structures-datagrid datasources.xml rendering.xml

From: Date: Sat, 11 Nov 2006 15:42:03 +0000
Subject: cvs: peardoc /en/package/structures/structures-datagrid datasources.xml rendering.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8754@lists.php.net to get a copy of this message
wiesemann Sat Nov 11 15:42:03 2006 UTC Modified files: /peardoc/en/package/structures/structures-datagrid datasources.xml rendering.xml Log: - correct and update information about DataSource and Renderer drivers http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/datasources.xml?r1=1.7&r2=1.8&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/datasources.xml diff -u peardoc/en/package/structures/structures-datagrid/datasources.xml:1.7 peardoc/en/package/structures/structures-datagrid/datasources.xml:1.8 --- peardoc/en/package/structures/structures-datagrid/datasources.xml:1.7 Sat Sep 30 07:30:41 2006 +++ peardoc/en/package/structures/structures-datagrid/datasources.xml Sat Nov 11 15:42:03 2006 @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="package.structures.structures-datagrid.datasources"> - <!-- FIXME There's something very wrong in this document. It has a - terrible style... And it contains obsolete informations. --> <refnamediv> <refname>DataSources</refname> - <refpurpose>What is a DataSource Driver?</refpurpose> + <refpurpose>What is a DataSource driver?</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -21,18 +19,26 @@ <refsect1> <title>How to use the drivers</title> <para> - To use the drivers, you can simply use the bind method, assuming your - DataSource is listed below, otherwise you can use the - <function>bindDataSource</function> - method. The - <link linkend="package.structures.structures-datagrid.structures-datagrid.bind"><function>bind</function></link> - method will attempt to detect the datasource type and - may not be 100% accurate. Because of this chance for error, you may - choose to use the <link - linkend="package.structures.structures-datagrid.structures-datagrid.binddatasource"><function>bindDataSource</function></link> - method where you can specifically define the datasource driver to use. - This method is also the method of choice if you are building your own - custom DataSource driver. + There are two methods intended to be used for binding a DataSource driver: + <link linkend="package.structures.structures-datagrid.structures-datagrid.bind"><function>bind</function></link> + and <link linkend="package.structures.structures-datagrid.structures-datagrid.binddatasource"><function>bindDataSource</function></link>. + </para> + <para> + The <function>bind</function> method is able to autodetect the right driver + in many cases. For example, you can pass <link + linkend="package.structures.structures-datagrid.structures-datagrid-datasource.dbtable">DB_Table</link> + or <link + linkend="package.structures.structures-datagrid.structures-datagrid-datasource.dataobject">DB_DataObject</link> + instances to it. Strings can't be autodetected because they could contain + CSV or XML data, for example. In such cases, you can specify the type as + the third parameter in the <function>bind</function> method call (e.g. + <literal>'CSV'</literal> or <literal>'XML'</literal>). + </para> + <para> + If you are building your own custom DataSource driver, using + <function>bindDataSource</function> is the method of choice. Just + instantiate your DataSource class and pass this instance to the + <function>bindDataSource</function> method. </para> </refsect1> <refsect1> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/rendering.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/rendering.xml diff -u peardoc/en/package/structures/structures-datagrid/rendering.xml:1.3 peardoc/en/package/structures/structures-datagrid/rendering.xml:1.4 --- peardoc/en/package/structures/structures-datagrid/rendering.xml:1.3 Sat Sep 30 07:30:41 2006 +++ peardoc/en/package/structures/structures-datagrid/rendering.xml Sat Nov 11 15:42:03 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.structures.structures-datagrid.rendering"> <refnamediv> <refname>Rendering the output</refname> @@ -17,12 +17,18 @@ <refsect1> <title>How do I change the renderer?</title> <para> - To use a different renderer other than the HTML Table, you can simply - change the renderer by either defining the renderer in the Constructor - method or by using the <link + To use a different renderer other than the HTML_Table renderer, you can + specify the name of the renderer (e.g. <literal>'CSV'</literal>, + <literal>'Pager'</literal> or <literal>'XML'</literal> as the first + parameter of the <link + linkend="package.structures.structures-datagrid.structures-datagrid.fill"><function>fill</function></link>, + <link linkend="package.structures.structures-datagrid.structures-datagrid.getoutput"><function>getOutput</function></link>, + and <link + linkend="package.structures.structures-datagrid.structures-datagrid.render"><function>render</function></link> + methods. Another possibility is to use <link linkend="package.structures.structures-datagrid.structures-datagrid.setrenderer"><function>setRenderer</function></link> - method. The parameter for defining the renderer is specified by one of - the renderer constants. + method. The old way of using the third parameter of the constructor to + define the renderer is deprecated since version 0.7.0. </para> </refsect1> <refsect1>

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