cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid/structures-datagrid-renderer flexy.xml
| From: | Mark Wiesemann | Date: | Sun, 11 Mar 2007 15:45:45 +0000 |
| Subject: | cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid/structures-datagrid-renderer flexy.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9511@lists.php.net to get a copy of this message | ||
wiesemann Sun Mar 11 15:45:45 2007 UTC
Added files:
/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer
flexy.xml
Modified files:
/peardoc/en/package/structures structures-datagrid.xml
Log:
- new page for new Flexy renderer
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid.xml?r1=1.41&r2=1.42&diff_format=u Index: peardoc/en/package/structures/structures-datagrid.xml diff -u peardoc/en/package/structures/structures-datagrid.xml:1.41 peardoc/en/package/structures/structures-datagrid.xml:1.42 --- peardoc/en/package/structures/structures-datagrid.xml:1.41 Fri Dec 15 14:39:03 2006 +++ peardoc/en/package/structures/structures-datagrid.xml Sun Mar 11 15:45:45 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.41 $ --> +<!-- $Revision: 1.42 $ --> <sect1 id="package.structures.structures-datagrid"> <title>Structures_DataGrid</title> <!-- @@ -147,6 +147,7 @@ <title>Renderer drivers</title> &package.structures.structures-datagrid.structures-datagrid-renderer.console; &package.structures.structures-datagrid.structures-datagrid-renderer.csv; +&package.structures.structures-datagrid.structures-datagrid-renderer.flexy; &package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform; &package.structures.structures-datagrid.structures-datagrid-renderer.htmlsortform; &package.structures.structures-datagrid.structures-datagrid-renderer.htmltable; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/flexy.xml?view=markup&rev=1.1 Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/flexy.xml +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/flexy.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy"> <refnamediv> <refname>Structures_DataGrid_Renderer_Flexy</refname> <refpurpose>Flexy Rendering Driver</refpurpose> </refnamediv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy.modes"> <title>Supported operations modes</title> <para> This driver supports the following operation modes: </para> <table> <title>Supported operations modes of this driver</title> <tgroup cols="2"> <thead> <row> <entry>Mode</entry> <entry>Supported?</entry> </row> </thead> <tbody> <row> <entry>Container Support</entry> <entry>yes</entry> </row> <row> <entry>Output Buffering</entry> <entry>yes</entry> </row> <row> <entry>Direct Rendering</entry> <entry>no</entry> </row> <row> <entry>Streaming</entry> <entry>no</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy.options"> <title>Options</title> <para> This driver accepts the following options: </para> <table> <title>Options for this driver</title> <tgroup cols="4"> <thead> <row> <entry>Option</entry> <entry>Type</entry> <entry>Description</entry> <entry>Default Value</entry> </row> </thead> <tbody> <row> <entry>assocColumns</entry> <entry>bool</entry> <entry>Whether or not to build the column header as an associate array.</entry> <entry>true</entry> </row> <row> <entry>buildFooter</entry> <entry>bool</entry> <entry>Whether to build the footer.</entry> <entry>true</entry> </row> <row> <entry>buildHeader</entry> <entry>bool</entry> <entry>Whether to build the header.</entry> <entry>true</entry> </row> <row> <entry>columnAttributes</entry> <entry>array</entry> <entry>Column cells attributes. This is an array of the form: array(fieldName => array(attribute => value, ...) ...) This option is only used by XML/HTML based drivers.</entry> <entry>array()</entry> </row> <row> <entry>columnNames</entry> <entry>array</entry> <entry>The set of column names to use for the column header.</entry> <entry>array()</entry> </row> <row> <entry>convertEntities</entry> <entry>bool</entry> <entry>Whether or not to convert html entities. This calls htmlspecialchars().</entry> <entry>true</entry> </row> <row> <entry>defaultCellValue</entry> <entry>string</entry> <entry>What value to put by default into empty cells.</entry> <entry>null</entry> </row> <row> <entry>defaultColumnValues</entry> <entry>array</entry> <entry>Per-column default cell value. This is an array of the form: array(fieldName => value, ...).</entry> <entry>array()</entry> </row> <row> <entry>encoding</entry> <entry>string</entry> <entry>The content encoding. If the mbstring extension is present the default value is set from mb_internal_encoding(), otherwise it is ISO-8859-1.</entry> <entry>'ISO-8859-1'</entry> </row> <row> <entry>evenRowAttribute</entry> <entry>string</entry> <entry>The css class to be used for the even row listings.</entry> <entry>'even'</entry> </row> <row> <entry>excludeVars</entry> <entry>array</entry> <entry>Variables to be removed from the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>extraVars</entry> <entry>array</entry> <entry>Variables to be added to the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>fillWithEmptyRows</entry> <entry>bool</entry> <entry>Ensures that all pages have the same number of rows.</entry> <entry>false</entry> </row> <row> <entry>formatter</entry> <entry>array</entry> <entry>The callback array for a column header formatter method.</entry> <entry>array($this,'defaultHeaderFormatter')</entry> </row> <row> <entry>hideColumnLinks</entry> <entry>array</entry> <entry>By default sorting links are enabled on all columns. With this option it is possible to disable sorting links on specific columns. This is an array of the form: array(fieldName, ...). This option only affects drivers that support sorting.</entry> <entry>array()</entry> </row> <row> <entry>numberAlign</entry> <entry>bool</entry> <entry>Whether to right-align numeric values.</entry> <entry>true</entry> </row> <row> <entry>oddRowAttribute</entry> <entry>string</entry> <entry>The css class to be used for odd row listings.</entry> <entry>'odd'</entry> </row> <row> <entry>pagerOptions</entry> <entry>array</entry> <entry>The custom options to be sent to the Pager renderer.</entry> <entry></entry> </row> <row> <entry>resultsFormat</entry> <entry>string</entry> <entry>The format of the results message in sprintf format.</entry> <entry>'You have %s results in %s pages'</entry> </row> <row> <entry>selfPath</entry> <entry>string</entry> <entry>The complete path for sorting and paging links.</entry> <entry>$_SERVER['PHP_SELF']</entry> </row> <row> <entry>sortingResetsPaging</entry> <entry>bool</entry> <entry>Whether sorting HTTP queries reset paging.</entry> <entry>true</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy.notes"> <title>General notes</title> <para> This driver does not support the render() method, it only is able to be attached setting the container to a current Flexy instance. Options to the renderer must also be passed using the setOptions() method. </para> <para> Flexy output is buffered using the DataGrid getOutput() method. </para> <para> This driver assigns the following Flexy template variables: - columnSet: array of columns' labels and sorting links - columnHeader: object of columns' labels and sorting links - recordSet: associate array of records values - numberedSet: numbered array of records values - currentPage: current page (starting from 1) - recordLimit: number of rows per page - pagesNum: number of pages - columnsNum: number of columns - recordsNum: number of records in the current page - totalRecordsNum: total number of records - firstRecord: first record number (starting from 1) - lastRecord: last record number (starting from 1) </para> <para> This driver also register a Smarty custom function named getPaging that can be called from Smarty templates with {getPaging} in order to print paging links. This function accepts any of the Pager::factory() options as parameters. </para> <para> Dynamic Template example, featuring sorting and paging: </para> <para> <programlisting> <!-- Show paging links using the custom getPaging function --> {getPaging():h} <p>Showing records {firstRecord} to {lastRecord} from {totalRecordsNum}, page {currentPage} of {pagesNum}</p> <table cellspacing="0"> <!-- Build header --> <tr> <th> {foreach:columnSet,column} <td><a href="{column[link]:h}">{column[label]:h}</a></td> {end:} </th> </tr> <!-- Build body --> <tr class="{getRowCSS()}" flexy:foreach="numberedSet,k,row"> {foreach:row,field} <td>{field}</td> {end:} </tr> </table> </programlisting> </para> <para> Static Template example, featuring sorting and paging: </para> <para> <programlisting> <table cellspacing="0"> <!-- Build header --> <tr> <th> <td> <a href="{columnHeader.name[link]:h}">{columnHeader.field1[label]:h}</a> </td> <td> <a href="{columnHeader.surname[link]:h}">{columnHeader.field2[label]:h}</a> </td> </th> </tr> <!-- Build body --> <tr class="{getRowCSS()}" flexy:foreach="recordSet,k,row"> <td>{row[field1]}</td> <td>{row[field2]}</td> </tr> </table> </programlisting> </para> <para> <programlisting> require_once 'HTML/Template/Flexy.php'; require_once 'Structures/DataGrid.php'; require_once 'Structures/DataGrid/Renderer/Flexy.php'; $tpl = new HTML_Template_Flexy($config['HTML_Template_Flexy']); $dg =& new Structures_DataGrid($_GET['setPerPage'] ? $_GET['setPerPage'] : 10,$_GET['page'] ? $_GET['page'] : 1); $dg->bind($dataObject); $renderer = new Structures_DataGrid_Renderer_Flexy(); $renderer->setContainer($tpl); $renderer->setOptions($config['Structures_DataGrid']); $dg->attachRenderer($renderer); $this->tpl->compile($template); echo $dg->getOutput(); </programlisting> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid.xml?r1=1.41&r2=1.42&diff_format=u Index: peardoc/en/package/structures/structures-datagrid.xml diff -u peardoc/en/package/structures/structures-datagrid.xml:1.41 peardoc/en/package/structures/structures-datagrid.xml:1.42 --- peardoc/en/package/structures/structures-datagrid.xml:1.41 Fri Dec 15 14:39:03 2006 +++ peardoc/en/package/structures/structures-datagrid.xml Sun Mar 11 15:45:45 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.41 $ --> +<!-- $Revision: 1.42 $ --> <sect1 id="package.structures.structures-datagrid"> <title>Structures_DataGrid</title> <!-- @@ -147,6 +147,7 @@ <title>Renderer drivers</title> &package.structures.structures-datagrid.structures-datagrid-renderer.console; &package.structures.structures-datagrid.structures-datagrid-renderer.csv; +&package.structures.structures-datagrid.structures-datagrid-renderer.flexy; &package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform; &package.structures.structures-datagrid.structures-datagrid-renderer.htmlsortform; &package.structures.structures-datagrid.structures-datagrid-renderer.htmltable; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/flexy.xml?view=markup&rev=1.1 Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/flexy.xml +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/flexy.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy"> <refnamediv> <refname>Structures_DataGrid_Renderer_Flexy</refname> <refpurpose>Flexy Rendering Driver</refpurpose> </refnamediv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy.modes"> <title>Supported operations modes</title> <para> This driver supports the following operation modes: </para> <table> <title>Supported operations modes of this driver</title> <tgroup cols="2"> <thead> <row> <entry>Mode</entry> <entry>Supported?</entry> </row> </thead> <tbody> <row> <entry>Container Support</entry> <entry>yes</entry> </row> <row> <entry>Output Buffering</entry> <entry>yes</entry> </row> <row> <entry>Direct Rendering</entry> <entry>no</entry> </row> <row> <entry>Streaming</entry> <entry>no</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy.options"> <title>Options</title> <para> This driver accepts the following options: </para> <table> <title>Options for this driver</title> <tgroup cols="4"> <thead> <row> <entry>Option</entry> <entry>Type</entry> <entry>Description</entry> <entry>Default Value</entry> </row> </thead> <tbody> <row> <entry>assocColumns</entry> <entry>bool</entry> <entry>Whether or not to build the column header as an associate array.</entry> <entry>true</entry> </row> <row> <entry>buildFooter</entry> <entry>bool</entry> <entry>Whether to build the footer.</entry> <entry>true</entry> </row> <row> <entry>buildHeader</entry> <entry>bool</entry> <entry>Whether to build the header.</entry> <entry>true</entry> </row> <row> <entry>columnAttributes</entry> <entry>array</entry> <entry>Column cells attributes. This is an array of the form: array(fieldName => array(attribute => value, ...) ...) This option is only used by XML/HTML based drivers.</entry> <entry>array()</entry> </row> <row> <entry>columnNames</entry> <entry>array</entry> <entry>The set of column names to use for the column header.</entry> <entry>array()</entry> </row> <row> <entry>convertEntities</entry> <entry>bool</entry> <entry>Whether or not to convert html entities. This calls htmlspecialchars().</entry> <entry>true</entry> </row> <row> <entry>defaultCellValue</entry> <entry>string</entry> <entry>What value to put by default into empty cells.</entry> <entry>null</entry> </row> <row> <entry>defaultColumnValues</entry> <entry>array</entry> <entry>Per-column default cell value. This is an array of the form: array(fieldName => value, ...).</entry> <entry>array()</entry> </row> <row> <entry>encoding</entry> <entry>string</entry> <entry>The content encoding. If the mbstring extension is present the default value is set from mb_internal_encoding(), otherwise it is ISO-8859-1.</entry> <entry>'ISO-8859-1'</entry> </row> <row> <entry>evenRowAttribute</entry> <entry>string</entry> <entry>The css class to be used for the even row listings.</entry> <entry>'even'</entry> </row> <row> <entry>excludeVars</entry> <entry>array</entry> <entry>Variables to be removed from the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>extraVars</entry> <entry>array</entry> <entry>Variables to be added to the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>fillWithEmptyRows</entry> <entry>bool</entry> <entry>Ensures that all pages have the same number of rows.</entry> <entry>false</entry> </row> <row> <entry>formatter</entry> <entry>array</entry> <entry>The callback array for a column header formatter method.</entry> <entry>array($this,'defaultHeaderFormatter')</entry> </row> <row> <entry>hideColumnLinks</entry> <entry>array</entry> <entry>By default sorting links are enabled on all columns. With this option it is possible to disable sorting links on specific columns. This is an array of the form: array(fieldName, ...). This option only affects drivers that support sorting.</entry> <entry>array()</entry> </row> <row> <entry>numberAlign</entry> <entry>bool</entry> <entry>Whether to right-align numeric values.</entry> <entry>true</entry> </row> <row> <entry>oddRowAttribute</entry> <entry>string</entry> <entry>The css class to be used for odd row listings.</entry> <entry>'odd'</entry> </row> <row> <entry>pagerOptions</entry> <entry>array</entry> <entry>The custom options to be sent to the Pager renderer.</entry> <entry></entry> </row> <row> <entry>resultsFormat</entry> <entry>string</entry> <entry>The format of the results message in sprintf format.</entry> <entry>'You have %s results in %s pages'</entry> </row> <row> <entry>selfPath</entry> <entry>string</entry> <entry>The complete path for sorting and paging links.</entry> <entry>$_SERVER['PHP_SELF']</entry> </row> <row> <entry>sortingResetsPaging</entry> <entry>bool</entry> <entry>Whether sorting HTTP queries reset paging.</entry> <entry>true</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.flexy.notes"> <title>General notes</title> <para> This driver does not support the render() method, it only is able to be attached setting the container to a current Flexy instance. Options to the renderer must also be passed using the setOptions() method. </para> <para> Flexy output is buffered using the DataGrid getOutput() method. </para> <para> This driver assigns the following Flexy template variables: - columnSet: array of columns' labels and sorting links - columnHeader: object of columns' labels and sorting links - recordSet: associate array of records values - numberedSet: numbered array of records values - currentPage: current page (starting from 1) - recordLimit: number of rows per page - pagesNum: number of pages - columnsNum: number of columns - recordsNum: number of records in the current page - totalRecordsNum: total number of records - firstRecord: first record number (starting from 1) - lastRecord: last record number (starting from 1) </para> <para> This driver also register a Smarty custom function named getPaging that can be called from Smarty templates with {getPaging} in order to print paging links. This function accepts any of the Pager::factory() options as parameters. </para> <para> Dynamic Template example, featuring sorting and paging: </para> <para> <programlisting> <!-- Show paging links using the custom getPaging function --> {getPaging():h} <p>Showing records {firstRecord} to {lastRecord} from {totalRecordsNum}, page {currentPage} of {pagesNum}</p> <table cellspacing="0"> <!-- Build header --> <tr> <th> {foreach:columnSet,column} <td><a href="{column[link]:h}">{column[label]:h}</a></td> {end:} </th> </tr> <!-- Build body --> <tr class="{getRowCSS()}" flexy:foreach="numberedSet,k,row"> {foreach:row,field} <td>{field}</td> {end:} </tr> </table> </programlisting> </para> <para> Static Template example, featuring sorting and paging: </para> <para> <programlisting> <table cellspacing="0"> <!-- Build header --> <tr> <th> <td> <a href="{columnHeader.name[link]:h}">{columnHeader.field1[label]:h}</a> </td> <td> <a href="{columnHeader.surname[link]:h}">{columnHeader.field2[label]:h}</a> </td> </th> </tr> <!-- Build body --> <tr class="{getRowCSS()}" flexy:foreach="recordSet,k,row"> <td>{row[field1]}</td> <td>{row[field2]}</td> </tr> </table> </programlisting> </para> <para> <programlisting> require_once 'HTML/Template/Flexy.php'; require_once 'Structures/DataGrid.php'; require_once 'Structures/DataGrid/Renderer/Flexy.php'; $tpl = new HTML_Template_Flexy($config['HTML_Template_Flexy']); $dg =& new Structures_DataGrid($_GET['setPerPage'] ? $_GET['setPerPage'] : 10,$_GET['page'] ? $_GET['page'] : 1); $dg->bind($dataObject); $renderer = new Structures_DataGrid_Renderer_Flexy(); $renderer->setContainer($tpl); $renderer->setOptions($config['Structures_DataGrid']); $dg->attachRenderer($renderer); $this->tpl->compile($template); echo $dg->getOutput(); </programlisting> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->