|
|
@@ -18,10 +18,10 @@
|
|
|
<para>
|
|
|
<classname>Zend_Text_Table</classname> expects your strings to be UTF-8 encoded
|
|
|
by default. If this is not the case, you can either supply the character
|
|
|
- encoding as a parameter to the <code>constructor</code> or the
|
|
|
- <code>setContent</code> method of <classname>Zend_Text_Table_Column</classname>.
|
|
|
- Alternatively if you have a different encoding in the entire
|
|
|
- process, you can define the standard input charset with
|
|
|
+ encoding as a parameter to the <methodname>constructor()</methodname> or the
|
|
|
+ <methodname>setContent()</methodname> method of
|
|
|
+ <classname>Zend_Text_Table_Column</classname>. Alternatively if you have a different
|
|
|
+ encoding in the entire process, you can define the standard input charset with
|
|
|
<methodname>Zend_Text_Table::setInputCharset($charset)</methodname>. In
|
|
|
case you need another output charset for the table, you can set
|
|
|
this with <methodname>Zend_Text_Table::setOutputCharset($charset)</methodname>.
|
|
|
@@ -37,30 +37,30 @@
|
|
|
<itemizedlist>
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <code>columnWidths</code> (required): An array defining
|
|
|
+ <property>columnWidths</property> (required): An array defining
|
|
|
all columns width their widths in characters.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <code>decorator</code>: The decorator to use for the
|
|
|
- table borders. The default is <code>unicode</code>, but
|
|
|
- you may also specify <code>ascii</code> or give an instance
|
|
|
+ <property>decorator</property>: The decorator to use for the
|
|
|
+ table borders. The default is <emphasis>unicode</emphasis>, but
|
|
|
+ you may also specify <emphasis>ascii</emphasis> or give an instance
|
|
|
of a custom decorator object.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <code>padding</code>: The left and right padding withing
|
|
|
+ <property>padding</property>: The left and right padding withing
|
|
|
the columns in characters. The default padding is zero.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <code>AutoSeparate</code>: The way how the rows are
|
|
|
+ <property>AutoSeparate</property>: The way how the rows are
|
|
|
separated with horizontal lines. The default is a
|
|
|
separation between all rows. This is defined as a bitmask
|
|
|
containing one ore more of the following constants of
|
|
|
@@ -94,8 +94,8 @@
|
|
|
<para>
|
|
|
Rows are simply added to the table by creating a new instance of
|
|
|
<classname>Zend_Text_Table_Row</classname>, and appending it to the table via the
|
|
|
- <code>appendRow</code> method. Rows themselves have no options. You can also
|
|
|
- give an array to directly to the <code>appendRow</code> method, which then
|
|
|
+ <methodname>appendRow()</methodname> method. Rows themselves have no options. You can also
|
|
|
+ give an array to directly to the <methodname>appendRow()</methodname> method, which then
|
|
|
will automatically converted to a row object, containing multiple column
|
|
|
objects.
|
|
|
</para>
|
|
|
@@ -103,11 +103,11 @@
|
|
|
<para>
|
|
|
The same way you can add columns to the rows. Create a new instance of
|
|
|
<classname>Zend_Text_Table_Column</classname> and then either set the column
|
|
|
- options in the constructor or later with the <code>set*</code> methods.
|
|
|
+ options in the constructor or later with the <methodname>set*()</methodname> methods.
|
|
|
The first parameter is the content of the column which may have
|
|
|
multiple lines, which in the best case are separated by just the
|
|
|
- <code>\n</code> character. The second parameter defines the align, which
|
|
|
- is <code>left</code> by default and can be one of the class constants of
|
|
|
+ '\n' character. The second parameter defines the align, which
|
|
|
+ is 'left' by default and can be one of the class constants of
|
|
|
<classname>Zend_Text_Table_Column</classname>:
|
|
|
|
|
|
<itemizedlist>
|
|
|
@@ -134,15 +134,16 @@
|
|
|
choose "2" as colspan, the column will span over two columns of the table.
|
|
|
The last parameter defines the encoding of the content, which should be
|
|
|
supplied, if the content is neither ASCII nor UTF-8. To append the column
|
|
|
- to the row, you simply call <code>appendColumn</code> in your row object
|
|
|
+ to the row, you simply call <methodname>appendColumn()</methodname> in your row object
|
|
|
with the column object as parameter. Alternatively you can directly
|
|
|
- give a string to the <code>appendColumn</code> method.
|
|
|
+ give a string to the <methodname>appendColumn()</methodname> method.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- To finally render the table, you can either use the <code>render</code>
|
|
|
- method of the table, or use the magic method <code>__toString</code>
|
|
|
- by doing <code>echo $table;</code> or <code>$tableString = (string) $table</code>.
|
|
|
+ To finally render the table, you can either use the <methodname>render()</methodname>
|
|
|
+ method of the table, or use the magic method <methodname>__toString()</methodname>
|
|
|
+ by doing <command>echo $table;</command> or
|
|
|
+ <command>$tableString = (string) $table</command>.
|
|
|
</para>
|
|
|
|
|
|
<example id="zend.text.table.example.using">
|