Zend_Validate-Messages.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 17230 -->
  4. <sect1 id="zend.validate.messages">
  5. <title>検証メッセージ</title>
  6. <para>
  7. <classname>Zend_Validate</classname> を継承したバリデータには、
  8. 検証に失敗したときに使用するメッセージが用意されています。
  9. ここにまとめた情報をもとに、
  10. 独自のメッセージを設定したりバリデータが返すメッセージを翻訳したりすることができます。
  11. 次の表は、各バリデータが返すすべてのメッセージをまとめたものです。
  12. </para>
  13. <table id="zend.validate.messages.table">
  14. <title>利用可能な検証メッセージ</title>
  15. <tgroup cols="4">
  16. <thead>
  17. <row>
  18. <entry>バリデータ</entry>
  19. <entry>定数</entry>
  20. <entry>メッセージ</entry>
  21. </row>
  22. </thead>
  23. <tbody>
  24. <row>
  25. <entry morerows="1" valign="middle">Alnum</entry>
  26. <entry><constant>NOT_ALNUM</constant></entry>
  27. <entry>'%value%' has not only alphabetic and digit characters</entry>
  28. </row>
  29. <row>
  30. <entry><constant>STRING_EMPTY</constant></entry>
  31. <entry>'%value%' is an empty string</entry>
  32. </row>
  33. <row>
  34. <entry morerows="1" valign="middle">Alpha</entry>
  35. <entry><constant>NOT_ALPHA</constant></entry>
  36. <entry>'%value%' has not only alphabetic characters</entry>
  37. </row>
  38. <row>
  39. <entry><constant>STRING_EMPTY</constant></entry>
  40. <entry>'%value%' is an empty string</entry>
  41. </row>
  42. <row>
  43. <entry>Barcode</entry>
  44. <entry>---</entry>
  45. <entry>messages are thrown by a subclass</entry>
  46. </row>
  47. <row>
  48. <entry morerows="2" valign="middle">Barcode_Ean13</entry>
  49. <entry><constant>INVALID</constant></entry>
  50. <entry>'%value%' is an invalid <constant>EAN</constant>-13 barcode</entry>
  51. </row>
  52. <row>
  53. <entry><constant>INVALID_LENGTH</constant></entry>
  54. <entry>'%value%' should be 13 characters</entry>
  55. </row>
  56. <row>
  57. <entry><constant>NOT_NUMERIC</constant></entry>
  58. <entry>'%value%' should contain only numeric characters</entry>
  59. </row>
  60. <row>
  61. <entry morerows="1" valign="middle">Barcode_UpcA</entry>
  62. <entry><constant>INVALID</constant></entry>
  63. <entry>'%value%' is an invalid <constant>UPC</constant>-A barcode</entry>
  64. </row>
  65. <row>
  66. <entry><constant>INVALID_LENGTH</constant></entry>
  67. <entry>'%value%' should be 12 characters</entry>
  68. </row>
  69. <row>
  70. <entry morerows="1" valign="middle">Between</entry>
  71. <entry><constant>NOT_BETWEEN</constant></entry>
  72. <entry>'%value%' is not between '%min%' and '%max%', inclusively</entry>
  73. </row>
  74. <row>
  75. <entry><constant>NOT_BETWEEN_STRICT</constant></entry>
  76. <entry>'%value%' is not strictly between '%min%' and '%max%'</entry>
  77. </row>
  78. <row>
  79. <entry morerows="1" valign="middle">Ccnum</entry>
  80. <entry><constant>LENGTH</constant></entry>
  81. <entry>'%value%' must contain between 13 and 19 digits</entry>
  82. </row>
  83. <row>
  84. <entry><constant>CHECKSUM</constant></entry>
  85. <entry>Luhn algorithm (mod-10 checksum) failed on '%value%'</entry>
  86. </row>
  87. <row>
  88. <entry morerows="2" valign="middle">Date</entry>
  89. <entry><constant>FALSEFORMAT</constant></entry>
  90. <entry>'%value%' does not fit given date format</entry>
  91. </row>
  92. <row>
  93. <entry><constant>INVALID</constant></entry>
  94. <entry>'%value%' does not appear to be a valid date</entry>
  95. </row>
  96. <row>
  97. <entry><constant>NOT_YYYY_MM_DD</constant></entry>
  98. <entry>'%value%' is not of the format YYYY-MM-DD</entry>
  99. </row>
  100. <row>
  101. <entry morerows="1" valign="middle">Db_Abstract</entry>
  102. <entry><constant>ERROR_NO_RECORD_FOUND</constant></entry>
  103. <entry>No record matching %value% was found</entry>
  104. </row>
  105. <row>
  106. <entry><constant>ERROR_RECORD_FOUND</constant></entry>
  107. <entry>A record matching %value% was found</entry>
  108. </row>
  109. <row>
  110. <entry morerows="1" valign="middle">Digits</entry>
  111. <entry><constant>NOT_DIGITS</constant></entry>
  112. <entry>'%value%' contains not only digit characters</entry>
  113. </row>
  114. <row>
  115. <entry><constant>STRING_EMPTY</constant></entry>
  116. <entry>'%value%' is an empty string</entry>
  117. </row>
  118. <row>
  119. <entry morerows="7" valign="middle">EmailAddress</entry>
  120. <entry><constant>INVALID</constant></entry>
  121. <entry>
  122. '%value%' is not a valid email address in the basic format
  123. local-part@hostname
  124. </entry>
  125. </row>
  126. <row>
  127. <entry><constant>INVALID_FORMAT</constant></entry>
  128. <entry>'%value%' is not a valid email address in the basic format local-part@hostname</entry>
  129. </row>
  130. <row>
  131. <entry><constant>INVALID_HOSTNAME</constant></entry>
  132. <entry>'%hostname%' is not a valid hostname for email address '%value%'</entry>
  133. </row>
  134. <row>
  135. <entry><constant>INVALID_MX_RECORD</constant></entry>
  136. <entry>
  137. '%hostname%' does not appear to have a valid MX record for the email address
  138. '%value%'
  139. </entry>
  140. </row>
  141. <row>
  142. <entry><constant>DOT_ATOM</constant></entry>
  143. <entry>'%localPart%' not matched against dot-atom format</entry>
  144. </row>
  145. <row>
  146. <entry><constant>QUOTED_STRING</constant></entry>
  147. <entry>'%localPart%' not matched against quoted-string format</entry>
  148. </row>
  149. <row>
  150. <entry><constant>INVALID_LOCAL_PART</constant></entry>
  151. <entry>
  152. '%localPart%' is not a valid local part for email address '%value%'
  153. </entry>
  154. </row>
  155. <row>
  156. <entry><constant>LENGTH_EXCEEDED</constant></entry>
  157. <entry>'%value%' exceeds the allowed length</entry>
  158. </row>
  159. <row>
  160. <entry morerows="1" valign="middle">File_Count</entry>
  161. <entry><constant>TOO_MUCH</constant></entry>
  162. <entry>
  163. Too much files, maximum '%max%' are allowed but '%count%' are given
  164. </entry>
  165. </row>
  166. <row>
  167. <entry><constant>TOO_LESS</constant></entry>
  168. <entry>
  169. Too less files, minimum '%min%' are expected but '%count%' are given
  170. </entry>
  171. </row>
  172. <row>
  173. <entry morerows="2" valign="middle">File_Crc32</entry>
  174. <entry><constant>DOES_NOT_MATCH</constant></entry>
  175. <entry>The file '%value%' does not match the given crc32 hashes</entry>
  176. </row>
  177. <row>
  178. <entry><constant>NOT_DETECTED</constant></entry>
  179. <entry>There was no crc32 hash detected for the given file</entry>
  180. </row>
  181. <row>
  182. <entry><constant>NOT_FOUND</constant></entry>
  183. <entry>The file '%value%' could not be found</entry>
  184. </row>
  185. <row>
  186. <entry morerows="1" valign="middle">File_ExcludeExtension</entry>
  187. <entry><constant>FALSE_EXTENSION</constant></entry>
  188. <entry>The file '%value%' has a false extension</entry>
  189. </row>
  190. <row>
  191. <entry><constant>NOT_FOUND</constant></entry>
  192. <entry>The file '%value%' was not found</entry>
  193. </row>
  194. <row>
  195. <entry morerows="2" valign="middle">File_ExcludeMimeType</entry>
  196. <entry><constant>FALSE_TYPE</constant></entry>
  197. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  198. </row>
  199. <row>
  200. <entry><constant>NOT_DETECTED</constant></entry>
  201. <entry>The mimetype of file '%value%' could not been detected</entry>
  202. </row>
  203. <row>
  204. <entry><constant>NOT_READABLE</constant></entry>
  205. <entry>The file '%value%' can not be read</entry>
  206. </row>
  207. <row>
  208. <entry morerows="2" valign="middle">File_Exists</entry>
  209. <entry><constant>DOES_NOT_EXIST</constant></entry>
  210. <entry>The file '%value%' does not exist</entry>
  211. </row>
  212. <row>
  213. <entry morerows="1" valign="middle">File_Extension</entry>
  214. <entry><constant>FALSE_EXTENSION</constant></entry>
  215. <entry>The file '%value%' has a false extension</entry>
  216. </row>
  217. <row>
  218. <entry><constant>NOT_FOUND</constant></entry>
  219. <entry>The file '%value%' was not found</entry>
  220. </row>
  221. <row>
  222. <entry morerows="2" valign="middle">File_FilesSize</entry>
  223. <entry><constant>TOO_BIG</constant></entry>
  224. <entry>
  225. All files in sum should have a maximum size of '%max%' but '%size%' were
  226. detected
  227. </entry>
  228. </row>
  229. <row>
  230. <entry><constant>TOO_SMALL</constant></entry>
  231. <entry>
  232. All files in sum should have a minimum size of '%min%' but '%size%' were
  233. detected
  234. </entry>
  235. </row>
  236. <row>
  237. <entry><constant>NOT_READABLE</constant></entry>
  238. <entry>One or more files can not be read</entry>
  239. </row>
  240. <row>
  241. <entry morerows="2" valign="middle">File_Hash</entry>
  242. <entry><constant>DOES_NOT_MATCH</constant></entry>
  243. <entry>The file '%value%' does not match the given hashes</entry>
  244. </row>
  245. <row>
  246. <entry><constant>NOT_DETECTED</constant></entry>
  247. <entry>There was no hash detected for the given file</entry>
  248. </row>
  249. <row>
  250. <entry><constant>NOT_FOUND</constant></entry>
  251. <entry>The file '%value%' could not be found</entry>
  252. </row>
  253. <row>
  254. <entry morerows="5" valign="middle">File_ImageSize</entry>
  255. <entry><constant>WIDTH_TOO_BIG</constant></entry>
  256. <entry>
  257. Maximum allowed width for image '%value%' should be '%maxwidth%' but
  258. '%width%' detected
  259. </entry>
  260. </row>
  261. <row>
  262. <entry><constant>WIDTH_TOO_SMALL</constant></entry>
  263. <entry>
  264. Minimum expected width for image '%value%' should be '%minwidth%' but
  265. '%width%' detected
  266. </entry>
  267. </row>
  268. <row>
  269. <entry><constant>HEIGHT_TOO_BIG</constant></entry>
  270. <entry>
  271. Maximum allowed height for image '%value%' should be '%maxheight%' but
  272. '%height%' detected
  273. </entry>
  274. </row>
  275. <row>
  276. <entry><constant>HEIGHT_TOO_SMALL</constant></entry>
  277. <entry>
  278. Minimum expected height for image '%value%' should be '%minheight%' but
  279. '%height%' detected
  280. </entry>
  281. </row>
  282. <row>
  283. <entry><constant>NOT_DETECTED</constant></entry>
  284. <entry>The size of image '%value%' could not be detected</entry>
  285. </row>
  286. <row>
  287. <entry><constant>NOT_READABLE</constant></entry>
  288. <entry>The image '%value%' can not be read</entry>
  289. </row>
  290. <row>
  291. <entry morerows="2" valign="middle">File_IsCompressed</entry>
  292. <entry><constant>FALSE_TYPE</constant></entry>
  293. <entry>The file '%value%' is not compressed, '%type%' detected</entry>
  294. </row>
  295. <row>
  296. <entry><constant>NOT_DETECTED</constant></entry>
  297. <entry>The mimetype of file '%value%' could not been detected</entry>
  298. </row>
  299. <row>
  300. <entry><constant>NOT_READABLE</constant></entry>
  301. <entry>The file '%value%' can not be read</entry>
  302. </row>
  303. <row>
  304. <entry morerows="2" valign="middle">File_IsImage</entry>
  305. <entry><constant>FALSE_TYPE</constant></entry>
  306. <entry>The file '%value%' is no image, '%type%' detected</entry>
  307. </row>
  308. <row>
  309. <entry><constant>NOT_DETECTED</constant></entry>
  310. <entry>The mimetype of file '%value%' could not been detected</entry>
  311. </row>
  312. <row>
  313. <entry><constant>NOT_READABLE</constant></entry>
  314. <entry>The file '%value%' can not be read</entry>
  315. </row>
  316. <row>
  317. <entry morerows="2" valign="middle">File_Md5</entry>
  318. <entry><constant>DOES_NOT_MATCH</constant></entry>
  319. <entry>The file '%value%' does not match the given md5 hashes</entry>
  320. </row>
  321. <row>
  322. <entry><constant>NOT_DETECTED</constant></entry>
  323. <entry>There was no md5 hash detected for the given file</entry>
  324. </row>
  325. <row>
  326. <entry><constant>NOT_FOUND</constant></entry>
  327. <entry>The file '%value%' could not be found</entry>
  328. </row>
  329. <row>
  330. <entry morerows="2" valign="middle">File_MimeType</entry>
  331. <entry><constant>FALSE_TYPE</constant></entry>
  332. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  333. </row>
  334. <row>
  335. <entry><constant>NOT_DETECTED</constant></entry>
  336. <entry>The mimetype of file '%value%' could not been detected</entry>
  337. </row>
  338. <row>
  339. <entry><constant>NOT_READABLE</constant></entry>
  340. <entry>The file '%value%' can not be read</entry>
  341. </row>
  342. <row>
  343. <entry>File_NotExists</entry>
  344. <entry><constant>DOES_EXIST</constant></entry>
  345. <entry>The file '%value%' does exist</entry>
  346. </row>
  347. <row>
  348. <entry morerows="2" valign="middle">File_Sha1</entry>
  349. <entry><constant>DOES_NOT_MATCH</constant></entry>
  350. <entry>The file '%value%' does not match the given sha1 hashes</entry>
  351. </row>
  352. <row>
  353. <entry><constant>NOT_DETECTED</constant></entry>
  354. <entry>There was no sha1 hash detected for the given file</entry>
  355. </row>
  356. <row>
  357. <entry><constant>NOT_FOUND</constant></entry>
  358. <entry>The file '%value%' could not be found</entry>
  359. </row>
  360. <row>
  361. <entry morerows="2" valign="middle">File_Size</entry>
  362. <entry><constant>TOO_BIG</constant></entry>
  363. <entry>
  364. Maximum allowed size for file '%value%' is '%max%' but '%size%' detected
  365. </entry>
  366. </row>
  367. <row>
  368. <entry><constant>TOO_SMALL</constant></entry>
  369. <entry>
  370. Minimum expected size for file '%value%' is '%min%' but '%size%' detected
  371. </entry>
  372. </row>
  373. <row>
  374. <entry><constant>NOT_FOUND</constant></entry>
  375. <entry>The file '%value%' could not be found</entry>
  376. </row>
  377. <row>
  378. <entry morerows="9" valign="middle">File_Upload</entry>
  379. <entry><constant>INI_SIZE</constant></entry>
  380. <entry>The file '%value%' exceeds the defined ini size</entry>
  381. </row>
  382. <row>
  383. <entry><constant>FORM_SIZE</constant></entry>
  384. <entry>The file '%value%' exceeds the defined form size</entry>
  385. </row>
  386. <row>
  387. <entry><constant>PARTIAL</constant></entry>
  388. <entry>The file '%value%' was only partially uploaded</entry>
  389. </row>
  390. <row>
  391. <entry><constant>NO_FILE</constant></entry>
  392. <entry>The file '%value%' was not uploaded</entry>
  393. </row>
  394. <row>
  395. <entry><constant>NO_TMP_DIR</constant></entry>
  396. <entry>No temporary directory was found for the file '%value%'</entry>
  397. </row>
  398. <row>
  399. <entry><constant>CANT_WRITE</constant></entry>
  400. <entry>The file '%value%' can't be written</entry>
  401. </row>
  402. <row>
  403. <entry><constant>EXTENSION</constant></entry>
  404. <entry>
  405. The extension returned an error while uploading the file '%value%'
  406. </entry>
  407. </row>
  408. <row>
  409. <entry><constant>ATTACK</constant></entry>
  410. <entry>The file '%value%' was illegal uploaded, possible attack</entry>
  411. </row>
  412. <row>
  413. <entry><constant>FILE_NOT_FOUND</constant></entry>
  414. <entry>The file '%value%' was not found</entry>
  415. </row>
  416. <row>
  417. <entry><constant>UNKNOWN</constant></entry>
  418. <entry>Unknown error while uploading the file '%value%'</entry>
  419. </row>
  420. <row>
  421. <entry morerows="2" valign="middle">File_WordCount</entry>
  422. <entry><constant>TOO_MUCH</constant></entry>
  423. <entry>
  424. Too much words, maximum '%max%' are allowed but '%count%' were counted
  425. </entry>
  426. </row>
  427. <row>
  428. <entry><constant>TOO_LESS</constant></entry>
  429. <entry>
  430. Too less words, minimum '%min%' are expected but '%count%' were counted
  431. </entry>
  432. </row>
  433. <row>
  434. <entry><constant>NOT_FOUND</constant></entry>
  435. <entry>The file '%value%' could not be found</entry>
  436. </row>
  437. <row>
  438. <entry>Float</entry>
  439. <entry><constant>NOT_FLOAT</constant></entry>
  440. <entry>'%value%' does not appear to be a float</entry>
  441. </row>
  442. <row>
  443. <entry>GreaterThan</entry>
  444. <entry><constant>NOT_GREATER</constant></entry>
  445. <entry>'%value%' is not greater than '%min%'</entry>
  446. </row>
  447. <row>
  448. <entry>Hex</entry>
  449. <entry><constant>NOT_HEX</constant></entry>
  450. <entry>'%value%' has not only hexadecimal digit characters</entry>
  451. </row>
  452. <row>
  453. <entry morerows="7" valign="middle">Hostname</entry>
  454. <entry><constant>IP_ADDRESS_NOT_ALLOWED</constant></entry>
  455. <entry>
  456. '%value%' appears to be an IP address, but IP addresses are not allowed
  457. </entry>
  458. </row>
  459. <row>
  460. <entry><constant>UNKNOWN_TLD</constant></entry>
  461. <entry>
  462. '%value%' appears to be a <acronym>DNS</acronym> hostname but cannot match <acronym>TLD</acronym> against known
  463. list
  464. </entry>
  465. </row>
  466. <row>
  467. <entry><constant>INVALID_DASH</constant></entry>
  468. <entry>
  469. '%value%' appears to be a <acronym>DNS</acronym> hostname but contains a dash (-) in an invalid
  470. position
  471. </entry>
  472. </row>
  473. <row>
  474. <entry><constant>INVALID_HOSTNAME_SCHEMA</constant></entry>
  475. <entry>
  476. '%value%' appears to be a <acronym>DNS</acronym> hostname but cannot match against hostname
  477. schema for <acronym>TLD</acronym> '%tld%'
  478. </entry>
  479. </row>
  480. <row>
  481. <entry><constant>UNDECIPHERABLE_TLD</constant></entry>
  482. <entry>
  483. '%value%' appears to be a <acronym>DNS</acronym> hostname but cannot extract <acronym>TLD</acronym> part
  484. </entry>
  485. </row>
  486. <row>
  487. <entry><constant>INVALID_HOSTNAME</constant></entry>
  488. <entry>
  489. '%value%' does not match the expected structure for a <acronym>DNS</acronym> hostname
  490. </entry>
  491. </row>
  492. <row>
  493. <entry><constant>INVALID_LOCAL_NAME</constant></entry>
  494. <entry>'%value%' does not appear to be a valid local network name</entry>
  495. </row>
  496. <row>
  497. <entry><constant>LOCAL_NAME_NOT_ALLOWED</constant></entry>
  498. <entry>
  499. '%value%' appears to be a local network name but local network names are not
  500. allowed
  501. </entry>
  502. </row>
  503. <row>
  504. <entry morerows="2" valign="middle">Iban</entry>
  505. <entry><constant>NOTSUPPORTED</constant></entry>
  506. <entry>'%value%' does not have <acronym>IBAN</acronym></entry>
  507. </row>
  508. <row>
  509. <entry><constant>FALSEFORMAT</constant></entry>
  510. <entry>'%value%' has a false format</entry>
  511. </row>
  512. <row>
  513. <entry><constant>CHECKFAILED</constant></entry>
  514. <entry>'%value%' has failed the <acronym>IBAN</acronym> check</entry>
  515. </row>
  516. <row>
  517. <entry morerows="1" valign="middle">Identical</entry>
  518. <entry><constant>NOT_SAME</constant></entry>
  519. <entry>The token '%token%' does not match the given token '%value%'</entry>
  520. </row>
  521. <row>
  522. <entry><constant>MISSING_TOKEN</constant></entry>
  523. <entry>No token was provided to match against</entry>
  524. </row>
  525. <row>
  526. <entry>InArray</entry>
  527. <entry><constant>NOT_IN_ARRAY</constant></entry>
  528. <entry>'%value%' was not found in the haystack</entry>
  529. </row>
  530. <row>
  531. <entry>Int</entry>
  532. <entry><constant>NOT_INT</constant></entry>
  533. <entry>'%value%' does not appear to be an integer</entry>
  534. </row>
  535. <row>
  536. <entry>Ip</entry>
  537. <entry><constant>NOT_IP_ADDRESS</constant></entry>
  538. <entry>'%value%' does not appear to be a valid IP address</entry>
  539. </row>
  540. <row>
  541. <entry>LessThan</entry>
  542. <entry><constant>NOT_LESS</constant></entry>
  543. <entry>'%value%' is not less than '%max%'</entry>
  544. </row>
  545. <row>
  546. <entry>NotEmpty</entry>
  547. <entry><constant>IS_EMPTY</constant></entry>
  548. <entry>Value is required and can't be empty</entry>
  549. </row>
  550. <row>
  551. <entry>Regex</entry>
  552. <entry><constant>NOT_MATCH</constant></entry>
  553. <entry>'%value%' does not match against pattern '%pattern%'</entry>
  554. </row>
  555. <row>
  556. <entry morerows="1" valign="middle">StringLength</entry>
  557. <entry><constant>TOO_SHORT</constant></entry>
  558. <entry>'%value%' is less than %min% characters long</entry>
  559. </row>
  560. <row>
  561. <entry><constant>TOO_LONG</constant></entry>
  562. <entry>'%value%' is greater than %max% characters long</entry>
  563. </row>
  564. </tbody>
  565. </tgroup>
  566. </table>
  567. <para>
  568. さらに、<methodname>getMessageTemplates()</methodname>
  569. メソッドを使うとバリデータの全メッセージテンプレートを取得することができます。
  570. これは、検証に失敗したときにバリデータが返す可能性のあるメッセージを配列で返します。
  571. </para>
  572. <programlisting language="php"><![CDATA[
  573. $validator = new Zend_Validate_Alnum();
  574. $messages = $validator->getMessageTemplates();
  575. ]]></programlisting>
  576. <sect2 id="zend.validate.messages.limitation">
  577. <title>検証メッセージのサイズの制限</title>
  578. <para>
  579. 検証メッセージの最大サイズを制限しなければならないこともあるでしょう。
  580. たとえば、1 行に 100 文字までしかレンダリングできないなどの制限がビューにある場合です。
  581. このような場合のため、<classname>Zend_Validate</classname>
  582. では自動的に検証メッセージの最大長を制限できるようになっています。
  583. </para>
  584. <para>
  585. 実際に設定されているサイズを取得するには
  586. <methodname>Zend_Validate::getMessageLength()</methodname> を使用します。
  587. この結果が -1 の場合は、返されるメッセージが切り詰められることはありません。
  588. これがデフォルトの挙動です。
  589. </para>
  590. <para>
  591. 返されるメッセージのサイズを制限するには
  592. <methodname>Zend_Validate::setMessageLength()</methodname> を使用します。
  593. 必要に応じて任意の整数値を設定します。
  594. 返されるメッセージのサイズがここで設定した長さを超えると、
  595. メッセージが切り詰められて最後に文字列 '<emphasis>...</emphasis>'
  596. が付加されます。
  597. </para>
  598. <programlisting language="php"><![CDATA[
  599. Zend_Validate::setMessageLength(100);
  600. ]]></programlisting>
  601. <note>
  602. <para>
  603. ここで設定したメッセージ長はすべてのバリデータに適用されることに注意しましょう。
  604. 自前で定義したバリデータに関しても、それが <classname>Zend_Validate_Abstract</classname>
  605. を継承したものである限りは同じです。
  606. </para>
  607. </note>
  608. </sect2>
  609. </sect1>
  610. <!--
  611. vim:se ts=4 sw=4 et:
  612. -->