forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'docs/view-helpers' of https://github.com/cgmartin/zf2
- Loading branch information
Showing
6 changed files
with
281 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
documentation/manual/en/module_specs/zend.i18n.filter.alnum.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="zend.i18n.filter.alnum"> | ||
<title>Alnum Filter</title> | ||
|
||
<para> | ||
The <classname>Alnum</classname> filter can be used to return | ||
only alphabetic characters and digits in the | ||
unicode "letter" and "number" categories, respectively. | ||
All other characters are supressed. | ||
</para> | ||
|
||
<example xml:id="zend.i18n.filter.alnum.options"> | ||
<title>Supported options for Alnum Filter</title> | ||
|
||
<para> | ||
The following options are supported for <classname>Alnum</classname>: | ||
</para> | ||
|
||
<para> | ||
<methodname>Alnum([ boolean $allowWhiteSpace [, string $locale ]])</methodname> | ||
</para> | ||
|
||
<itemizedlist> | ||
<listitem> | ||
<para> | ||
<varname>$allowWhiteSpace</varname> : If set to true then | ||
whitespace characters are allowed. Otherwise they are | ||
suppressed. Default is "false" (whitespace is not allowed). | ||
</para> | ||
<para> | ||
Methods for getting/setting the allowWhiteSpace option | ||
are also available: | ||
<methodname>getAllowWhiteSpace()</methodname> and | ||
<methodname>setAllowWhiteSpace()</methodname> | ||
</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
<varname>$locale</varname> : The locale string used in | ||
identifying the characters to filter | ||
(locale name, e.g. en_US). If unset, it will use the | ||
default locale | ||
(<classname>Locale::getDefault()</classname>). | ||
</para> | ||
<para> | ||
Methods for getting/setting the locale are also available: | ||
<methodname>getLocale()</methodname> and | ||
<methodname>setLocale()</methodname> | ||
</para> | ||
</listitem> | ||
</itemizedlist> | ||
</example> | ||
|
||
<example xml:id="zend.i18n.filter.alnum.usage"> | ||
<title>Alnum Filter Usage</title> | ||
|
||
<programlisting language="php"><![CDATA[ | ||
// Default settings, deny whitespace | ||
$filter = \Zend\I18n\Filter\Alnum(); | ||
echo $filter->filter("This is (my) content: 123"); | ||
// Returns "Thisismycontent123" | ||
// First param in constructor is $allowWhiteSpace | ||
$filter = \Zend\I18n\Filter\Alnum(true); | ||
echo $filter->filter("This is (my) content: 123"); | ||
// Returns "This is my content 123" | ||
]]></programlisting> | ||
|
||
<note> | ||
<para> | ||
Note: <classname>Alnum</classname> works on almost all | ||
languages, except: Chinese, Japanese and Korean. | ||
Within these languages the english alphabet is used | ||
instead of the characters from these languages. | ||
The language itself is detected using the | ||
<classname>Locale</classname>. | ||
</para> | ||
</note> | ||
</example> | ||
|
||
</section> |
81 changes: 81 additions & 0 deletions
81
documentation/manual/en/module_specs/zend.i18n.filter.alpha.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="zend.i18n.filter.alpha"> | ||
<title>Alpha Filter</title> | ||
|
||
<para> | ||
The <classname>Alpha</classname> filter can be used to return | ||
only alphabetic characters in the unicode "letter" category. | ||
All other characters are supressed. | ||
</para> | ||
|
||
<example xml:id="zend.i18n.filter.alpha.options"> | ||
<title>Supported options for Alpha Filter</title> | ||
|
||
<para> | ||
The following options are supported for <classname>Alpha</classname>: | ||
</para> | ||
|
||
<para> | ||
<methodname>Alpha([ boolean $allowWhiteSpace [, string $locale ]])</methodname> | ||
</para> | ||
|
||
<itemizedlist> | ||
<listitem> | ||
<para> | ||
<varname>$allowWhiteSpace</varname> : If set to true then | ||
whitespace characters are allowed. Otherwise they are | ||
suppressed. Default is "false" (whitespace is not allowed). | ||
</para> | ||
<para> | ||
Methods for getting/setting the allowWhiteSpace option | ||
are also available: | ||
<methodname>getAllowWhiteSpace()</methodname> and | ||
<methodname>setAllowWhiteSpace()</methodname> | ||
</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
<varname>$locale</varname> : The locale string used in | ||
identifying the characters to filter | ||
(locale name, e.g. en_US). If unset, it will use the | ||
default locale | ||
(<classname>Locale::getDefault()</classname>). | ||
</para> | ||
<para> | ||
Methods for getting/setting the locale are also available: | ||
<methodname>getLocale()</methodname> and | ||
<methodname>setLocale()</methodname> | ||
</para> | ||
</listitem> | ||
</itemizedlist> | ||
</example> | ||
|
||
<example xml:id="zend.i18n.filter.alpha.usage"> | ||
<title>Alpha Filter Usage</title> | ||
|
||
<programlisting language="php"><![CDATA[ | ||
// Default settings, deny whitespace | ||
$filter = \Zend\I18n\Filter\Alpha(); | ||
echo $filter->filter("This is (my) content: 123"); | ||
// Returns "Thisismycontent" | ||
// Allow whitespace | ||
$filter = \Zend\I18n\Filter\Alpha(true); | ||
echo $filter->filter("This is (my) content: 123"); | ||
// Returns "This is my content " | ||
]]></programlisting> | ||
|
||
<note> | ||
<para> | ||
Note: <classname>Alpha</classname> works on almost all | ||
languages, except: Chinese, Japanese and Korean. | ||
Within these languages the english alphabet is used | ||
instead of the characters from these languages. | ||
The language itself is detected using the | ||
<classname>Locale</classname>. | ||
</para> | ||
|
||
</note> | ||
</example> | ||
|
||
</section> |
86 changes: 86 additions & 0 deletions
86
documentation/manual/en/module_specs/zend.i18n.filter.number-format.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="zend.i18n.filter.number-format"> | ||
<title>NumberFormat Filter</title> | ||
|
||
<para> | ||
The <classname>NumberFormat</classname> filter can be used to return | ||
locale-specific number and percentage strings. | ||
It acts as a wrapper for the <classname>NumberFormatter</classname> | ||
class within the Internationalization extension (Intl). | ||
</para> | ||
|
||
<example xml:id="zend.i18n.filter.number-format.options"> | ||
<title>Supported options for NumberFormat Filter</title> | ||
|
||
<para> | ||
The following options are supported for <classname>NumberFormat</classname>: | ||
</para> | ||
|
||
<para> | ||
<methodname>NumberFormat([ string $locale [, int $style [, int $type ]]])</methodname> | ||
</para> | ||
|
||
<itemizedlist> | ||
<listitem> | ||
<para> | ||
<varname>$locale</varname> : (Optional) Locale in which the number would be formatted (locale name, e.g. en_US). | ||
If unset, it will use the default locale (<classname>Locale::getDefault()</classname>) | ||
</para> | ||
|
||
<para> | ||
Methods for getting/setting the locale are also available: | ||
<methodname>getLocale()</methodname> and | ||
<methodname>setLocale()</methodname> | ||
</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
<varname>$style</varname> : (Optional) Style of the formatting, one of the | ||
<link xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xlink:href="http://us.php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants.unumberformatstyle" | ||
>format style constants</link>. | ||
If unset, it will use <varname>NumberFormatter::DEFAULT_STYLE</varname> as the default style. | ||
</para> | ||
<para> | ||
Methods for getting/setting the format style are also available: | ||
<methodname>getStyle()</methodname> and | ||
<methodname>setStyle()</methodname> | ||
</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
<varname>$type</varname> : (Optional) The | ||
<link xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xlink:href="http://us.php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants.types" | ||
>formatting type</link> to use. | ||
If unset, it will use <varname>NumberFormatter::TYPE_DOUBLE</varname> as the default type. | ||
</para> | ||
<para> | ||
Methods for getting/setting the format type are also available: | ||
<methodname>getType()</methodname> and | ||
<methodname>setType()</methodname> | ||
</para> | ||
</listitem> | ||
|
||
</itemizedlist> | ||
</example> | ||
|
||
<example xml:id="zend.i18n.filter.number-format.usage"> | ||
<title>NumberFormat Filter Usage</title> | ||
|
||
<programlisting language="php"><![CDATA[ | ||
$filter = \Zend\I18n\Filter\NumberFormat("de_DE"); | ||
echo $filter->filter(1234567.8912346); | ||
// Returns "1.234.567,891" | ||
$filter = \Zend\I18n\Filter\NumberFormat("en_US", NumberFormatter::PERCENT); | ||
echo $filter->filter(0.80); | ||
// Returns "80%" | ||
$filter = \Zend\I18n\Filter\NumberFormat("fr_FR", NumberFormatter::SCIENTIFIC); | ||
echo $filter->filter(0.00123456789); | ||
// Returns "1,23456789E-3" | ||
]]></programlisting> | ||
</example> | ||
|
||
</section> |
13 changes: 13 additions & 0 deletions
13
documentation/manual/en/module_specs/zend.i18n.filters.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<section xmlns="http://docbook.org/ns/docbook" version="5.0" | ||
xml:id="zend.i18n.filters"> | ||
<title>I18n Filters</title> | ||
|
||
<para> | ||
Zend Framework comes with a set of filters related to Internationalization. | ||
</para> | ||
|
||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zend.i18n.filter.alnum.xml"/> | ||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zend.i18n.filter.alpha.xml"/> | ||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zend.i18n.filter.number-format.xml"/> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters