|
@@ -80,7 +80,7 @@ echo $htmlEntities->filter('"'); // "
|
|
|
<para>
|
|
<para>
|
|
|
If it is inconvenient to load a given filter class and create an
|
|
If it is inconvenient to load a given filter class and create an
|
|
|
instance of the filter, you can use the static method
|
|
instance of the filter, you can use the static method
|
|
|
- <classname>Zend_Filter::get()</classname> as an alternative invocation style.
|
|
|
|
|
|
|
+ <classname>Zend_Filter::filterStatic()</classname> as an alternative invocation style.
|
|
|
The first argument of this method is a data input value, that you
|
|
The first argument of this method is a data input value, that you
|
|
|
would pass to the <code>filter()</code> method. The second
|
|
would pass to the <code>filter()</code> method. The second
|
|
|
argument is a string, which corresponds to the basename of the
|
|
argument is a string, which corresponds to the basename of the
|
|
@@ -90,7 +90,7 @@ echo $htmlEntities->filter('"'); // "
|
|
|
input.
|
|
input.
|
|
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
<programlisting language="php"><![CDATA[
|
|
|
-echo Zend_Filter::get('&', 'HtmlEntities');
|
|
|
|
|
|
|
+echo Zend_Filter::filterStatic('&', 'HtmlEntities');
|
|
|
]]></programlisting>
|
|
]]></programlisting>
|
|
|
|
|
|
|
|
</para>
|
|
</para>
|
|
@@ -100,7 +100,7 @@ echo Zend_Filter::get('&', 'HtmlEntities');
|
|
|
are needed for the filter class.
|
|
are needed for the filter class.
|
|
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
<programlisting language="php"><![CDATA[
|
|
|
-echo Zend_Filter::get('"', 'HtmlEntities', array(ENT_QUOTES));
|
|
|
|
|
|
|
+echo Zend_Filter::filterStatic('"', 'HtmlEntities', array(ENT_QUOTES));
|
|
|
]]></programlisting>
|
|
]]></programlisting>
|
|
|
|
|
|
|
|
</para>
|
|
</para>
|
|
@@ -125,12 +125,12 @@ echo Zend_Filter::get('"', 'HtmlEntities', array(ENT_QUOTES));
|
|
|
|
|
|
|
|
<para>
|
|
<para>
|
|
|
When working with self defined filters you can give a forth parameter
|
|
When working with self defined filters you can give a forth parameter
|
|
|
- to <methodname>Zend_Filter::get()</methodname> which is the namespace
|
|
|
|
|
|
|
+ to <methodname>Zend_Filter::filterStatic()</methodname> which is the namespace
|
|
|
where your filter can be found.
|
|
where your filter can be found.
|
|
|
</para>
|
|
</para>
|
|
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
<programlisting language="php"><![CDATA[
|
|
|
-echo Zend_Filter::get(
|
|
|
|
|
|
|
+echo Zend_Filter::filterStatic(
|
|
|
'"',
|
|
'"',
|
|
|
'MyFilter',
|
|
'MyFilter',
|
|
|
array($parameters),
|
|
array($parameters),
|
|
@@ -141,14 +141,14 @@ echo Zend_Filter::get(
|
|
|
<para>
|
|
<para>
|
|
|
<classname>Zend_Filter</classname> allows also to set namespaces as default.
|
|
<classname>Zend_Filter</classname> allows also to set namespaces as default.
|
|
|
This means that you can set them once in your bootstrap and have not to give
|
|
This means that you can set them once in your bootstrap and have not to give
|
|
|
- them again for each call of <methodname>Zend_Filter::get()</methodname>. The
|
|
|
|
|
- following code snippet is identical to the above one.
|
|
|
|
|
|
|
+ them again for each call of <methodname>Zend_Filter::filterStatic()</methodname>.
|
|
|
|
|
+ The following code snippet is identical to the above one.
|
|
|
</para>
|
|
</para>
|
|
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
<programlisting language="php"><![CDATA[
|
|
|
Zend_Filter::setDefaultNamespaces(array('FirstNamespace', 'SecondNamespace'));
|
|
Zend_Filter::setDefaultNamespaces(array('FirstNamespace', 'SecondNamespace'));
|
|
|
-echo Zend_Filter::get('"', 'MyFilter', array($parameters));
|
|
|
|
|
-echo Zend_Filter::get('"', 'OtherFilter', array($parameters));
|
|
|
|
|
|
|
+echo Zend_Filter::filterStatic('"', 'MyFilter', array($parameters));
|
|
|
|
|
+echo Zend_Filter::filterStatic('"', 'OtherFilter', array($parameters));
|
|
|
]]></programlisting>
|
|
]]></programlisting>
|
|
|
|
|
|
|
|
<para>
|
|
<para>
|