cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid/structures-datagrid seturlformat.xml /en/package/structures/structures-datagrid/structures-datagrid-column setformatter.xml
[email protected] ("Mark Wiesemann")
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <cvswiesemann1193605977@cvsserver> |
wiesemann Sun Oct 28 21:12:57 2007 UTC
Added files:
/peardoc/en/package/structures/structures-datagrid/structures-datagrid
seturlformat.xml
Modified files:
/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column
setformatter.xml
/peardoc/en/package/structures structures-datagrid.xml
Log:
- sync phpdoc changes from source code
- new page for new method setUrlFormat()
(thanks to Sascha Grossenbacher)
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml?r1=1.15&r2=1.16&diff_format=u
Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml
diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.15 peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.16
--- peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.15 Sun Jul 8 15:31:04 2007
+++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml Sun Oct 28 21:12:56 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
-<!-- $Revision: 1.15 $ -->
+<!-- $Revision: 1.16 $ -->
<refentry id="package.structures.structures-datagrid.structures-datagrid-column.setformatter">
<refnamediv>
<refname>
@@ -31,6 +31,21 @@
<refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.desc">
&title.desc;
<para>Define a formatting callback function with optional arguments for this column.</para>
+ <para>
+ The callback function receives the following array as its first argument:
+ <programlisting role="php">
+<![CDATA[ array(
+ 'record' => associative array of all fields values for this record,
+ 'fieldName' => the field name of this column,
+ 'columnName' => the label (header) of this column,
+ 'orderBy' => the field name to sort this column by,
+ 'attribs' => this column's attributes,
+ 'currRow' => zero-based row index,
+ 'currCol' => zero-based column index,
+ );]]>
+ </programlisting>
+ </para>
+ <para>If you pass the optional $arguments parameter to setFormatter(), the callback function will receive it as its second argument.</para>
</refsect1>
<refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.param">
&title.param;
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid.xml?r1=1.44&r2=1.45&diff_format=u
Index: peardoc/en/package/structures/structures-datagrid.xml
diff -u peardoc/en/package/structures/structures-datagrid.xml:1.44 peardoc/en/package/structures/structures-datagrid.xml:1.45
--- peardoc/en/package/structures/structures-datagrid.xml:1.44 Sun Jul 22 14:39:04 2007
+++ peardoc/en/package/structures/structures-datagrid.xml Sun Oct 28 21:12:57 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
-<!-- $Revision: 1.44 $ -->
+<!-- $Revision: 1.45 $ -->
<sect1 id="package.structures.structures-datagrid">
<title>Structures_DataGrid</title>
<!--
@@ -83,6 +83,7 @@
&package.structures.structures-datagrid.structures-datagrid.setrendereroption;
&package.structures.structures-datagrid.structures-datagrid.setrendereroptions;
&package.structures.structures-datagrid.structures-datagrid.setrequestprefix;
+&package.structures.structures-datagrid.structures-datagrid.seturlformat;
&package.structures.structures-datagrid.structures-datagrid.sortrecordset;
</sect2>
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/seturlformat.xml?view=markup&rev=1.1
Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/seturlformat.xml
+++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/seturlformat.xml
<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- $Revision: 1.1 $ -->
<refentry id="package.structures.structures-datagrid.structures-datagrid.seturlformat">
<refnamediv>
<refname>
<function>Structures_DataGrid::setUrlFormat</function>
</refname>
<refpurpose>Set the URL format</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>require_once 'Structures/DataGrid.php';</funcsynopsisinfo>
<funcprototype>
<funcdef>
void
<function>Structures_DataGrid::setUrlFormat</function>
</funcdef>
<paramdef>
string
<parameter>$format</parameter>
</paramdef>
<paramdef>
string
<parameter>
<optional>$prefix = &null;</optional>
</parameter>
</paramdef>
<paramdef>
string
<parameter>
<optional>$scriptname = &null;</optional>
</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="package.structures.structures-datagrid.structures-datagrid.seturlformat.desc">
&title.desc;
<para>If this is set, it will be parsed instead of GET/POST. This is only supported on PHP5, as it depends on Net_URL_Mapper.</para>
<para>There are three possible placeholders, :pager, :orderBy and :direction. :page or (:orderBy and :direction) can be used alone.</para>
<para>It is possible to use multipe DataGrid instances on one page with different prefixes.</para>
</refsect1>
<refsect1 id="package.structures.structures-datagrid.structures-datagrid.seturlformat.param">
&title.param;
<para>
<variablelist>
<varlistentry>
<term>
&type.string;
<parameter>$format</parameter>
</term>
<listitem>
<para>The URL format, see example</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>
&type.string;
<parameter>$prefix</parameter>
</term>
<listitem>
<para>Sets the url prefix</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>
&type.string;
<parameter>$scriptname</parameter>
</term>
<listitem>
<para>Set the scriptname if mod_rewrite not available</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 id="package.structures.structures-datagrid.structures-datagrid.seturlformat.throws">
&title.throws;
<para>
<emphasis>throws</emphasis>
Net_URL_Mapper_InvalidException
</para>
</refsect1>
<refsect1 id="package.structures.structures-datagrid.structures-datagrid.seturlformat.example">
<title>Examples</title>
<para>
<example>
<title>configure a url format</title>
<programlisting role="php">
<![CDATA[<?php
// identical, for example /page/5/foo/ASC
$datagrid->setUrlFormat('/page/:page/:orderBy/:direction');
$datagrid->setUrlFormat('/:page/:orderBy/:direction', 'page');
// without /page, for example /5/foo/ASC
$datagrid->setUrlFormat('/:page/:orderBy/:direction');
// without paging, for example /sort/foo/ASC
$datagrid->setUrlFormat('/:orderBy/:direction', 'sort');
// with scriptname, for example /index.php/5/foo/ASC
$datagrid->setUrlFormat('/:page/:orderBy/:direction', 'page', 'index.php');
?>]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 id="package.structures.structures-datagrid.structures-datagrid.seturlformat.note">
&title.note;
¬e.notstatic;
</refsect1>
</refentry>