Zend_Validate-Alpha.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 24249 -->
  4. <sect2 id="zend.validate.set.alpha">
  5. <title>Alpha(一部日本語)</title>
  6. <para>
  7. <classname>Zend_Validate_Alpha</classname> により、
  8. 与えられた文字列がアルファベットだけを含むかどうか検証できます。
  9. 検証したい入力に対する長さの制限はありません。
  10. このバリデータは数字を受け付けませんが、
  11. <classname>Zend_Validate_Alnum</classname> と関係があります。
  12. (訳注:ここでいうアルファベット、とはアラビア文字やタイ文字、キリール文字など、各言語で使われる文字の集合を意味します。英字<emphasis>とは限りません</emphasis>)
  13. </para>
  14. <sect3 id="zend.validate.set.alpha.options">
  15. <title>Zend_Validate_Alpha でサポートされるオプション</title>
  16. <para>
  17. 下記のオプションが <classname>Zend_Validate_Alpha</classname> でサポートされます。
  18. </para>
  19. <itemizedlist>
  20. <listitem>
  21. <para>
  22. <emphasis><property>allowWhiteSpace</property></emphasis>: 空白文字が許されるかどうか。
  23. このオプションの既定値は <constant>FALSE</constant> です。
  24. </para>
  25. </listitem>
  26. </itemizedlist>
  27. </sect3>
  28. <sect3 id="zend.validate.set.alpha.basic">
  29. <title>基本的な使用法</title>
  30. <para>
  31. 下記は基本的な使用例です。
  32. </para>
  33. <!-- TODO : to be translated -->
  34. <programlisting language="php"><![CDATA[
  35. $validator = new Zend_Validate_Alpha();
  36. if ($validator->isValid('Abcd')) {
  37. // value contains only allowed chars
  38. } else {
  39. // false
  40. }
  41. ]]></programlisting>
  42. </sect3>
  43. <sect3 id="zend.validate.set.alpha.whitespace">
  44. <title>空白を使用</title>
  45. <para>
  46. Per default whitespaces are not accepted because they are not part of the alphabet.
  47. Still, there is a way to accept them as input. This allows to validate complete
  48. sentences or phrases.
  49. </para>
  50. <para>
  51. To allow the usage of whitespaces you need to give the
  52. <property>allowWhiteSpace</property> option. This can be done while creating an instance
  53. of the validator, or afterwards by using <methodname>setAllowWhiteSpace()</methodname>.
  54. To get the actual state you can use <methodname>getAllowWhiteSpace()</methodname>.
  55. </para>
  56. <programlisting language="php"><![CDATA[
  57. $validator = new Zend_Validate_Alpha(array('allowWhiteSpace' => true));
  58. if ($validator->isValid('Abcd and efg')) {
  59. // value contains only allowed chars
  60. } else {
  61. // false
  62. }
  63. ]]></programlisting>
  64. </sect3>
  65. <sect3 id="zend.validate.set.alpha.languages">
  66. <title>別の言語を使用</title>
  67. <para>
  68. When using <classname>Zend_Validate_Alpha</classname> then the language which the user
  69. sets within his browser will be used to set the allowed characters. This means when your
  70. user sets <emphasis>de</emphasis> for german then he can also enter characters like
  71. <emphasis>ä</emphasis>, <emphasis>ö</emphasis> and <emphasis>ü</emphasis> additionally
  72. to the characters from the english alphabet.
  73. </para>
  74. <para>
  75. Which characters are allowed depends completly on the used language as every language
  76. defines it's own set of characters.
  77. </para>
  78. <para>
  79. 実際には、それらの固有の文書で受け付けられない3つの言語があります。
  80. それらの言語は、<emphasis>Korean</emphasis>、<emphasis>日本語</emphasis>、
  81. <emphasis>中国語</emphasis>です。
  82. <!-- TODO : to be translated -->
  83. because this languages are using an alphabet where a
  84. single character is build by using multiple characters.
  85. </para>
  86. <para>
  87. これらの言語を使用する場合、入力は英語のアルファベットを使用した検証のみ行なわれます。
  88. </para>
  89. </sect3>
  90. </sect2>
  91. <!--
  92. vim:se ts=4 sw=4 et:
  93. -->