Sfoglia il codice sorgente

ZF-8964 modificaions to chapter for Zend_Filter_StringTrim per documentation spec. Documentation test is passing.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22254 44c647ce-9c0f-0410-b52a-842ac1e357ba
wilmoore 15 anni fa
parent
commit
4f64029136

+ 1 - 9
documentation/manual/en/module_specs/Zend_Filter-Set.xml

@@ -26,15 +26,7 @@
     <xi:include href="Zend_Filter-RealPath.xml" />
     <xi:include href="Zend_Filter-StringToLower.xml" />
     <xi:include href="Zend_Filter-StringToUpper.xml" />
-
-    <sect2 id="zend.filter.set.stringtrim">
-        <title>StringTrim</title>
-
-        <para>
-            Returns the string <varname>$value</varname> with characters stripped from the
-            beginning and end.
-        </para>
-    </sect2>
+    <xi:include href="Zend_Filter-StringTrim.xml" />
 
     <sect2 id="zend.filter.set.stripnewlines">
         <title>StripNewlines</title>

+ 74 - 0
documentation/manual/en/module_specs/Zend_Filter-StringTrim.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Reviewed: no -->
+<sect2 id="zend.filter.set.stringtrim">
+    <title>StringTrim</title>
+
+    <para>
+        This filter modifies a given string such that certain characters are removed from the
+        beginning and end.
+    </para>
+
+     <sect3 id="zend.filter.set.stringtrim.options">
+        <title>Supported options for Zend_Filter_StringTrim</title>
+
+        <para>
+            The following options are supported for <classname>Zend_Filter_StringTrim</classname>:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    <emphasis><property>charlist</property></emphasis>: List of characters to
+                    remove from the beginning and end of the string. If this is not set or is null,
+                    the default behavior will be invoked, which is to remove only whitespace from
+                    the beginning and end of the string.
+                </para>
+            </listitem>
+        </itemizedlist>
+    </sect3>
+
+
+    <sect3 id="zend.filter.set.stringtrim.basic">
+        <title>Basic usage</title>
+
+        <para>
+            A basic example of usage is below:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+$filter = new Zend_Filter_StringTrim();
+
+print $filter->filter(' This is (my) content: ');
+]]></programlisting>
+
+        <para>
+            The above example returns 'This is (my) content:'. Notice that the whitespace characters
+            have been removed.
+        </para>
+
+    </sect3>
+
+
+    <sect3 id="zend.filter.set.stringtrim.types">
+        <title>Default behaviour for Zend_Filter_StringTrim</title>
+
+        <programlisting language="php"><![CDATA[
+$filter = new Zend_Filter_StringTrim(':'); // or new Zend_Filter_StringTrim(array('charlist' => ':'));
+
+print $filter->filter(' This is (my) content:');
+]]></programlisting>
+
+        <para>
+            The above example returns 'This is (my) content'. Notice that the whitespace characters
+            and colon are removed. You can also provide an instance of
+            <classname>Zend_Config</classname> or an array with a 'charlist' key. To set the
+            desired character list after instantiation, use the
+            <methodname>setCharList()</methodname> method.
+            The <methodname>getCharList()</methodname> return the values set for charlist.
+        </para>
+    </sect3>
+
+</sect2>
+<!--
+vim:se ts=4 sw=4 et:
+-->