1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect2 id="zend.validate.set.alpha">
7 <classname>Zend_Validate_Alpha</classname> allows you to validate if a given value contains
8 only alphabetical characters. There is no length limitation for the input you want to
9 validate. This validator is related to the <classname>Zend_Validate_Alnum</classname>
10 validator with the exception that it does not accept digits.
13 <sect3 id="zend.validate.set.alpha.options">
14 <title>Supported options for Zend_Validate_Alpha</title>
17 The following options are supported for <classname>Zend_Validate_Alpha</classname>:
23 <emphasis><property>allowWhiteSpace</property></emphasis>: If whitespace
24 characters are allowed. This option defaults to <constant>FALSE</constant>
30 <sect3 id="zend.validate.set.alpha.basic">
31 <title>Basic usage</title>
34 A basic example is the following one:
37 <programlisting language="php"><![CDATA[
38 $validator = new Zend_Validate_Alpha();
39 if ($validator->isValid('Abcd')) {
40 // value contains only allowed chars
47 <sect3 id="zend.validate.set.alpha.whitespace">
48 <title>Using whitespaces</title>
51 Per default whitespaces are not accepted because they are not part of the alphabet.
52 Still, there is a way to accept them as input. This allows to validate complete
57 To allow the usage of whitespaces you need to give the
58 <property>allowWhiteSpace</property> option. This can be done while creating an instance
59 of the validator, or afterwards by using <methodname>setAllowWhiteSpace()</methodname>.
60 To get the actual state you can use <methodname>getAllowWhiteSpace()</methodname>.
63 <programlisting language="php"><![CDATA[
64 $validator = new Zend_Validate_Alpha(array('allowWhiteSpace' => true));
65 if ($validator->isValid('Abcd and efg')) {
66 // value contains only allowed chars
73 <sect3 id="zend.validate.set.alpha.languages">
74 <title>Using different languages</title>
77 When using <classname>Zend_Validate_Alpha</classname> then the language which the user
78 sets within his browser will be used to set the allowed characters. This means when your
79 user sets <emphasis>de</emphasis> for german then he can also enter characters like
80 <emphasis>ä</emphasis>, <emphasis>ö</emphasis> and <emphasis>ü</emphasis> additionally
81 to the characters from the english alphabet.
85 Which characters are allowed depends completly on the used language as every language
86 defines it's own set of characters.
90 There are actually 3 languages which are not accepted in their own script. These
91 languages are <emphasis>korean</emphasis>, <emphasis>japanese</emphasis> and
92 <emphasis>chinese</emphasis> because this languages are using an alphabet where a
93 single character is build by using multiple characters.
97 In the case you are using these languages, the input will only be validated by using