Zend_Validate-Alnum.xml 4.1 KB

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