Zend_Validate-Messages.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- EN-Revision: 18942 -->
  3. <!-- Reviewed: no -->
  4. <sect1 id="zend.validate.messages">
  5. <title>Messages de validation</title>
  6. <para>
  7. Chaque validateur basé sur <classname>Zend_Validate</classname> propose un ou plusieurs messages
  8. dans le cas d'un echec. Vous pouvez utiliser ces informations pour créer vos propres messages
  9. ou pour traduire les messages présents. La table suivante liste tous les messages retournés
  10. par tous les validateurs.
  11. </para>
  12. <table id="zend.validate.messages.table">
  13. <title>Messages de validation disponibles</title>
  14. <tgroup cols="3">
  15. <thead>
  16. <row>
  17. <entry>Validator</entry>
  18. <entry>Constant</entry>
  19. <entry>Message</entry>
  20. </row>
  21. </thead>
  22. <tbody>
  23. <row>
  24. <entry morerows="1" valign="middle">Alnum</entry>
  25. <entry><constant>NOT_ALNUM</constant></entry>
  26. <entry>'%value%' has not only alphabetic and digit characters</entry>
  27. </row>
  28. <row>
  29. <entry><constant>STRING_EMPTY</constant></entry>
  30. <entry>'%value%' is an empty string</entry>
  31. </row>
  32. <row>
  33. <entry morerows="1" valign="middle">Alpha</entry>
  34. <entry><constant>NOT_ALPHA</constant></entry>
  35. <entry>'%value%' has not only alphabetic characters</entry>
  36. </row>
  37. <row>
  38. <entry><constant>STRING_EMPTY</constant></entry>
  39. <entry>'%value%' is an empty string</entry>
  40. </row>
  41. <row>
  42. <entry>Barcode</entry>
  43. <entry>---</entry>
  44. <entry>messages are thrown by a subclass</entry>
  45. </row>
  46. <row>
  47. <entry morerows="2" valign="middle">Barcode_Ean13</entry>
  48. <entry><constant>INVALID</constant></entry>
  49. <entry>'%value%' is an invalid <constant>EAN</constant>-13 barcode</entry>
  50. </row>
  51. <row>
  52. <entry><constant>INVALID_LENGTH</constant></entry>
  53. <entry>'%value%' should be 13 characters</entry>
  54. </row>
  55. <row>
  56. <entry><constant>NOT_NUMERIC</constant></entry>
  57. <entry>'%value%' should contain only numeric characters</entry>
  58. </row>
  59. <row>
  60. <entry morerows="1" valign="middle">Barcode_UpcA</entry>
  61. <entry><constant>INVALID</constant></entry>
  62. <entry>'%value%' is an invalid <constant>UPC</constant>-A barcode</entry>
  63. </row>
  64. <row>
  65. <entry><constant>INVALID_LENGTH</constant></entry>
  66. <entry>'%value%' should be 12 characters</entry>
  67. </row>
  68. <row>
  69. <entry morerows="1" valign="middle">Between</entry>
  70. <entry><constant>NOT_BETWEEN</constant></entry>
  71. <entry>'%value%' is not between '%min%' and '%max%', inclusively</entry>
  72. </row>
  73. <row>
  74. <entry><constant>NOT_BETWEEN_STRICT</constant></entry>
  75. <entry>'%value%' is not strictly between '%min%' and '%max%'</entry>
  76. </row>
  77. <row>
  78. <entry morerows="1" valign="middle">Ccnum</entry>
  79. <entry><constant>LENGTH</constant></entry>
  80. <entry>'%value%' must contain between 13 and 19 digits</entry>
  81. </row>
  82. <row>
  83. <entry><constant>CHECKSUM</constant></entry>
  84. <entry>Luhn algorithm (mod-10 checksum) failed on '%value%'</entry>
  85. </row>
  86. <row>
  87. <entry morerows="1" valign="middle">Date</entry>
  88. <entry><constant>FALSEFORMAT</constant></entry>
  89. <entry>'%value%' does not fit given date format</entry>
  90. </row>
  91. <row>
  92. <entry><constant>INVALID</constant></entry>
  93. <entry>'%value%' does not appear to be a valid date</entry>
  94. </row>
  95. <row>
  96. <entry morerows="1" valign="middle">Db_Abstract</entry>
  97. <entry><constant>ERROR_NO_RECORD_FOUND</constant></entry>
  98. <entry>No record matching %value% was found</entry>
  99. </row>
  100. <row>
  101. <entry><constant>ERROR_RECORD_FOUND</constant></entry>
  102. <entry>A record matching %value% was found</entry>
  103. </row>
  104. <row>
  105. <entry morerows="1" valign="middle">Digits</entry>
  106. <entry><constant>NOT_DIGITS</constant></entry>
  107. <entry>'%value%' contains not only digit characters</entry>
  108. </row>
  109. <row>
  110. <entry><constant>STRING_EMPTY</constant></entry>
  111. <entry>'%value%' is an empty string</entry>
  112. </row>
  113. <row>
  114. <entry morerows="7" valign="middle">EmailAddress</entry>
  115. <entry><constant>INVALID</constant></entry>
  116. <entry>
  117. '%value%' is not a valid email address in the basic format
  118. local-part@hostname
  119. </entry>
  120. </row>
  121. <row>
  122. <entry><constant>INVALID_FORMAT</constant></entry>
  123. <entry>'%value%' is not a valid email address in the basic format local-part@hostname</entry>
  124. </row>
  125. <row>
  126. <entry><constant>INVALID_HOSTNAME</constant></entry>
  127. <entry>'%hostname%' is not a valid hostname for email address '%value%'</entry>
  128. </row>
  129. <row>
  130. <entry><constant>INVALID_MX_RECORD</constant></entry>
  131. <entry>
  132. '%hostname%' does not appear to have a valid MX record for the email address
  133. '%value%'
  134. </entry>
  135. </row>
  136. <row>
  137. <entry><constant>DOT_ATOM</constant></entry>
  138. <entry>'%localPart%' not matched against dot-atom format</entry>
  139. </row>
  140. <row>
  141. <entry><constant>QUOTED_STRING</constant></entry>
  142. <entry>'%localPart%' not matched against quoted-string format</entry>
  143. </row>
  144. <row>
  145. <entry><constant>INVALID_LOCAL_PART</constant></entry>
  146. <entry>
  147. '%localPart%' is not a valid local part for email address '%value%'
  148. </entry>
  149. </row>
  150. <row>
  151. <entry><constant>LENGTH_EXCEEDED</constant></entry>
  152. <entry>'%value%' exceeds the allowed length</entry>
  153. </row>
  154. <row>
  155. <entry morerows="1" valign="middle">File_Count</entry>
  156. <entry><constant>TOO_MUCH</constant></entry>
  157. <entry>
  158. Too much files, maximum '%max%' are allowed but '%count%' are given
  159. </entry>
  160. </row>
  161. <row>
  162. <entry><constant>TOO_LESS</constant></entry>
  163. <entry>
  164. Too less files, minimum '%min%' are expected but '%count%' are given
  165. </entry>
  166. </row>
  167. <row>
  168. <entry morerows="2" valign="middle">File_Crc32</entry>
  169. <entry><constant>DOES_NOT_MATCH</constant></entry>
  170. <entry>The file '%value%' does not match the given crc32 hashes</entry>
  171. </row>
  172. <row>
  173. <entry><constant>NOT_DETECTED</constant></entry>
  174. <entry>There was no crc32 hash detected for the given file</entry>
  175. </row>
  176. <row>
  177. <entry><constant>NOT_FOUND</constant></entry>
  178. <entry>The file '%value%' could not be found</entry>
  179. </row>
  180. <row>
  181. <entry morerows="1" valign="middle">File_ExcludeExtension</entry>
  182. <entry><constant>FALSE_EXTENSION</constant></entry>
  183. <entry>The file '%value%' has a false extension</entry>
  184. </row>
  185. <row>
  186. <entry><constant>NOT_FOUND</constant></entry>
  187. <entry>The file '%value%' was not found</entry>
  188. </row>
  189. <row>
  190. <entry morerows="2" valign="middle">File_ExcludeMimeType</entry>
  191. <entry><constant>FALSE_TYPE</constant></entry>
  192. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  193. </row>
  194. <row>
  195. <entry><constant>NOT_DETECTED</constant></entry>
  196. <entry>The mimetype of file '%value%' could not been detected</entry>
  197. </row>
  198. <row>
  199. <entry><constant>NOT_READABLE</constant></entry>
  200. <entry>The file '%value%' can not be read</entry>
  201. </row>
  202. <row>
  203. <entry>File_Exists</entry>
  204. <entry><constant>DOES_NOT_EXIST</constant></entry>
  205. <entry>The file '%value%' does not exist</entry>
  206. </row>
  207. <row>
  208. <entry morerows="1" valign="middle">File_Extension</entry>
  209. <entry><constant>FALSE_EXTENSION</constant></entry>
  210. <entry>The file '%value%' has a false extension</entry>
  211. </row>
  212. <row>
  213. <entry><constant>NOT_FOUND</constant></entry>
  214. <entry>The file '%value%' was not found</entry>
  215. </row>
  216. <row>
  217. <entry morerows="2" valign="middle">File_FilesSize</entry>
  218. <entry><constant>TOO_BIG</constant></entry>
  219. <entry>
  220. All files in sum should have a maximum size of '%max%' but '%size%' were
  221. detected
  222. </entry>
  223. </row>
  224. <row>
  225. <entry><constant>TOO_SMALL</constant></entry>
  226. <entry>
  227. All files in sum should have a minimum size of '%min%' but '%size%' were
  228. detected
  229. </entry>
  230. </row>
  231. <row>
  232. <entry><constant>NOT_READABLE</constant></entry>
  233. <entry>One or more files can not be read</entry>
  234. </row>
  235. <row>
  236. <entry morerows="2" valign="middle">File_Hash</entry>
  237. <entry><constant>DOES_NOT_MATCH</constant></entry>
  238. <entry>The file '%value%' does not match the given hashes</entry>
  239. </row>
  240. <row>
  241. <entry><constant>NOT_DETECTED</constant></entry>
  242. <entry>There was no hash detected for the given file</entry>
  243. </row>
  244. <row>
  245. <entry><constant>NOT_FOUND</constant></entry>
  246. <entry>The file '%value%' could not be found</entry>
  247. </row>
  248. <row>
  249. <entry morerows="5" valign="middle">File_ImageSize</entry>
  250. <entry><constant>WIDTH_TOO_BIG</constant></entry>
  251. <entry>
  252. Maximum allowed width for image '%value%' should be '%maxwidth%' but
  253. '%width%' detected
  254. </entry>
  255. </row>
  256. <row>
  257. <entry><constant>WIDTH_TOO_SMALL</constant></entry>
  258. <entry>
  259. Minimum expected width for image '%value%' should be '%minwidth%' but
  260. '%width%' detected
  261. </entry>
  262. </row>
  263. <row>
  264. <entry><constant>HEIGHT_TOO_BIG</constant></entry>
  265. <entry>
  266. Maximum allowed height for image '%value%' should be '%maxheight%' but
  267. '%height%' detected
  268. </entry>
  269. </row>
  270. <row>
  271. <entry><constant>HEIGHT_TOO_SMALL</constant></entry>
  272. <entry>
  273. Minimum expected height for image '%value%' should be '%minheight%' but
  274. '%height%' detected
  275. </entry>
  276. </row>
  277. <row>
  278. <entry><constant>NOT_DETECTED</constant></entry>
  279. <entry>The size of image '%value%' could not be detected</entry>
  280. </row>
  281. <row>
  282. <entry><constant>NOT_READABLE</constant></entry>
  283. <entry>The image '%value%' can not be read</entry>
  284. </row>
  285. <row>
  286. <entry morerows="2" valign="middle">File_IsCompressed</entry>
  287. <entry><constant>FALSE_TYPE</constant></entry>
  288. <entry>The file '%value%' is not compressed, '%type%' detected</entry>
  289. </row>
  290. <row>
  291. <entry><constant>NOT_DETECTED</constant></entry>
  292. <entry>The mimetype of file '%value%' could not been detected</entry>
  293. </row>
  294. <row>
  295. <entry><constant>NOT_READABLE</constant></entry>
  296. <entry>The file '%value%' can not be read</entry>
  297. </row>
  298. <row>
  299. <entry morerows="2" valign="middle">File_IsImage</entry>
  300. <entry><constant>FALSE_TYPE</constant></entry>
  301. <entry>The file '%value%' is no image, '%type%' detected</entry>
  302. </row>
  303. <row>
  304. <entry><constant>NOT_DETECTED</constant></entry>
  305. <entry>The mimetype of file '%value%' could not been detected</entry>
  306. </row>
  307. <row>
  308. <entry><constant>NOT_READABLE</constant></entry>
  309. <entry>The file '%value%' can not be read</entry>
  310. </row>
  311. <row>
  312. <entry morerows="2" valign="middle">File_Md5</entry>
  313. <entry><constant>DOES_NOT_MATCH</constant></entry>
  314. <entry>The file '%value%' does not match the given md5 hashes</entry>
  315. </row>
  316. <row>
  317. <entry><constant>NOT_DETECTED</constant></entry>
  318. <entry>There was no md5 hash detected for the given file</entry>
  319. </row>
  320. <row>
  321. <entry><constant>NOT_FOUND</constant></entry>
  322. <entry>The file '%value%' could not be found</entry>
  323. </row>
  324. <row>
  325. <entry morerows="2" valign="middle">File_MimeType</entry>
  326. <entry><constant>FALSE_TYPE</constant></entry>
  327. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  328. </row>
  329. <row>
  330. <entry><constant>NOT_DETECTED</constant></entry>
  331. <entry>The mimetype of file '%value%' could not been detected</entry>
  332. </row>
  333. <row>
  334. <entry><constant>NOT_READABLE</constant></entry>
  335. <entry>The file '%value%' can not be read</entry>
  336. </row>
  337. <row>
  338. <entry>File_NotExists</entry>
  339. <entry><constant>DOES_EXIST</constant></entry>
  340. <entry>The file '%value%' does exist</entry>
  341. </row>
  342. <row>
  343. <entry morerows="2" valign="middle">File_Sha1</entry>
  344. <entry><constant>DOES_NOT_MATCH</constant></entry>
  345. <entry>The file '%value%' does not match the given sha1 hashes</entry>
  346. </row>
  347. <row>
  348. <entry><constant>NOT_DETECTED</constant></entry>
  349. <entry>There was no sha1 hash detected for the given file</entry>
  350. </row>
  351. <row>
  352. <entry><constant>NOT_FOUND</constant></entry>
  353. <entry>The file '%value%' could not be found</entry>
  354. </row>
  355. <row>
  356. <entry morerows="2" valign="middle">File_Size</entry>
  357. <entry><constant>TOO_BIG</constant></entry>
  358. <entry>
  359. Maximum allowed size for file '%value%' is '%max%' but '%size%' detected
  360. </entry>
  361. </row>
  362. <row>
  363. <entry><constant>TOO_SMALL</constant></entry>
  364. <entry>
  365. Minimum expected size for file '%value%' is '%min%' but '%size%' detected
  366. </entry>
  367. </row>
  368. <row>
  369. <entry><constant>NOT_FOUND</constant></entry>
  370. <entry>The file '%value%' could not be found</entry>
  371. </row>
  372. <row>
  373. <entry morerows="9" valign="middle">File_Upload</entry>
  374. <entry><constant>INI_SIZE</constant></entry>
  375. <entry>The file '%value%' exceeds the defined ini size</entry>
  376. </row>
  377. <row>
  378. <entry><constant>FORM_SIZE</constant></entry>
  379. <entry>The file '%value%' exceeds the defined form size</entry>
  380. </row>
  381. <row>
  382. <entry><constant>PARTIAL</constant></entry>
  383. <entry>The file '%value%' was only partially uploaded</entry>
  384. </row>
  385. <row>
  386. <entry><constant>NO_FILE</constant></entry>
  387. <entry>The file '%value%' was not uploaded</entry>
  388. </row>
  389. <row>
  390. <entry><constant>NO_TMP_DIR</constant></entry>
  391. <entry>No temporary directory was found for the file '%value%'</entry>
  392. </row>
  393. <row>
  394. <entry><constant>CANT_WRITE</constant></entry>
  395. <entry>The file '%value%' can't be written</entry>
  396. </row>
  397. <row>
  398. <entry><constant>EXTENSION</constant></entry>
  399. <entry>
  400. The extension returned an error while uploading the file '%value%'
  401. </entry>
  402. </row>
  403. <row>
  404. <entry><constant>ATTACK</constant></entry>
  405. <entry>The file '%value%' was illegal uploaded, possible attack</entry>
  406. </row>
  407. <row>
  408. <entry><constant>FILE_NOT_FOUND</constant></entry>
  409. <entry>The file '%value%' was not found</entry>
  410. </row>
  411. <row>
  412. <entry><constant>UNKNOWN</constant></entry>
  413. <entry>Unknown error while uploading the file '%value%'</entry>
  414. </row>
  415. <row>
  416. <entry morerows="2" valign="middle">File_WordCount</entry>
  417. <entry><constant>TOO_MUCH</constant></entry>
  418. <entry>
  419. Too much words, maximum '%max%' are allowed but '%count%' were counted
  420. </entry>
  421. </row>
  422. <row>
  423. <entry><constant>TOO_LESS</constant></entry>
  424. <entry>
  425. Too less words, minimum '%min%' are expected but '%count%' were counted
  426. </entry>
  427. </row>
  428. <row>
  429. <entry><constant>NOT_FOUND</constant></entry>
  430. <entry>The file '%value%' could not be found</entry>
  431. </row>
  432. <row>
  433. <entry>Float</entry>
  434. <entry><constant>NOT_FLOAT</constant></entry>
  435. <entry>'%value%' does not appear to be a float</entry>
  436. </row>
  437. <row>
  438. <entry>GreaterThan</entry>
  439. <entry><constant>NOT_GREATER</constant></entry>
  440. <entry>'%value%' is not greater than '%min%'</entry>
  441. </row>
  442. <row>
  443. <entry>Hex</entry>
  444. <entry><constant>NOT_HEX</constant></entry>
  445. <entry>'%value%' has not only hexadecimal digit characters</entry>
  446. </row>
  447. <row>
  448. <entry morerows="7" valign="middle">Hostname</entry>
  449. <entry><constant>IP_ADDRESS_NOT_ALLOWED</constant></entry>
  450. <entry>
  451. '%value%' appears to be an IP address, but IP addresses are not allowed
  452. </entry>
  453. </row>
  454. <row>
  455. <entry><constant>UNKNOWN_TLD</constant></entry>
  456. <entry>
  457. '%value%' appears to be a <acronym>DNS</acronym> hostname but cannot match <acronym>TLD</acronym> against known
  458. list
  459. </entry>
  460. </row>
  461. <row>
  462. <entry><constant>INVALID_DASH</constant></entry>
  463. <entry>
  464. '%value%' appears to be a <acronym>DNS</acronym> hostname but contains a dash (-) in an invalid
  465. position
  466. </entry>
  467. </row>
  468. <row>
  469. <entry><constant>INVALID_HOSTNAME_SCHEMA</constant></entry>
  470. <entry>
  471. '%value%' appears to be a <acronym>DNS</acronym> hostname but cannot match against hostname
  472. schema for <acronym>TLD</acronym> '%tld%'
  473. </entry>
  474. </row>
  475. <row>
  476. <entry><constant>UNDECIPHERABLE_TLD</constant></entry>
  477. <entry>
  478. '%value%' appears to be a <acronym>DNS</acronym> hostname but cannot extract <acronym>TLD</acronym> part
  479. </entry>
  480. </row>
  481. <row>
  482. <entry><constant>INVALID_HOSTNAME</constant></entry>
  483. <entry>
  484. '%value%' does not match the expected structure for a <acronym>DNS</acronym> hostname
  485. </entry>
  486. </row>
  487. <row>
  488. <entry><constant>INVALID_LOCAL_NAME</constant></entry>
  489. <entry>'%value%' does not appear to be a valid local network name</entry>
  490. </row>
  491. <row>
  492. <entry><constant>LOCAL_NAME_NOT_ALLOWED</constant></entry>
  493. <entry>
  494. '%value%' appears to be a local network name but local network names are not
  495. allowed
  496. </entry>
  497. </row>
  498. <row>
  499. <entry morerows="2" valign="middle">Iban</entry>
  500. <entry><constant>NOTSUPPORTED</constant></entry>
  501. <entry>'%value%' does not have <acronym>IBAN</acronym></entry>
  502. </row>
  503. <row>
  504. <entry><constant>FALSEFORMAT</constant></entry>
  505. <entry>'%value%' has a false format</entry>
  506. </row>
  507. <row>
  508. <entry><constant>CHECKFAILED</constant></entry>
  509. <entry>'%value%' has failed the <acronym>IBAN</acronym> check</entry>
  510. </row>
  511. <row>
  512. <entry morerows="1" valign="middle">Identical</entry>
  513. <entry><constant>NOT_SAME</constant></entry>
  514. <entry>The token '%token%' does not match the given token '%value%'</entry>
  515. </row>
  516. <row>
  517. <entry><constant>MISSING_TOKEN</constant></entry>
  518. <entry>No token was provided to match against</entry>
  519. </row>
  520. <row>
  521. <entry>InArray</entry>
  522. <entry><constant>NOT_IN_ARRAY</constant></entry>
  523. <entry>'%value%' was not found in the haystack</entry>
  524. </row>
  525. <row>
  526. <entry>Int</entry>
  527. <entry><constant>NOT_INT</constant></entry>
  528. <entry>'%value%' does not appear to be an integer</entry>
  529. </row>
  530. <row>
  531. <entry>Ip</entry>
  532. <entry><constant>NOT_IP_ADDRESS</constant></entry>
  533. <entry>'%value%' does not appear to be a valid IP address</entry>
  534. </row>
  535. <row>
  536. <entry>LessThan</entry>
  537. <entry><constant>NOT_LESS</constant></entry>
  538. <entry>'%value%' is not less than '%max%'</entry>
  539. </row>
  540. <row>
  541. <entry>NotEmpty</entry>
  542. <entry><constant>IS_EMPTY</constant></entry>
  543. <entry>Value is required and can't be empty</entry>
  544. </row>
  545. <row>
  546. <entry>Regex</entry>
  547. <entry><constant>NOT_MATCH</constant></entry>
  548. <entry>'%value%' does not match against pattern '%pattern%'</entry>
  549. </row>
  550. <row>
  551. <entry morerows="1" valign="middle">StringLength</entry>
  552. <entry><constant>TOO_SHORT</constant></entry>
  553. <entry>'%value%' is less than %min% characters long</entry>
  554. </row>
  555. <row>
  556. <entry><constant>TOO_LONG</constant></entry>
  557. <entry>'%value%' is greater than %max% characters long</entry>
  558. </row>
  559. </tbody>
  560. </tgroup>
  561. </table>
  562. <para>
  563. Il est possible de récupérer tous les messages d'erreurs d'un validator grâce à sa méthode
  564. <methodname>getMessageTemplates()</methodname>. Celle-ci retourne un tableau.
  565. </para>
  566. <programlisting language="php"><![CDATA[
  567. $validator = new Zend_Validate_Alnum();
  568. $messages = $validator->getMessageTemplates();
  569. ]]></programlisting>
  570. <sect2 id="zend.validate.messages.limitation">
  571. <title>Limiter la taille d'un message de validation</title>
  572. <para>
  573. Il peut être nécessaire parfois de limiter la taille en caractères des messages d'erreur
  574. retournés. par exemple si une vue n'autorise que 100 caractères par ligne.
  575. <classname>Zend_Validate</classname> propose une telle option.
  576. </para>
  577. <para>
  578. La taille actuelle est
  579. <methodname>Zend_Validate::getMessageLength()</methodname>. -1 signifie que le message ne
  580. sera pas tronqué et entièrement retourné, c'est le comportement par défaut.
  581. </para>
  582. <para>
  583. Pour limiter la taille, utilisez
  584. <methodname>Zend_Validate::setMessageLength()</methodname>. Lorsque la taille excède cette valeur,
  585. le message sera alors tronqué et suivi de '<emphasis>...</emphasis>'.
  586. </para>
  587. <programlisting language="php"><![CDATA[
  588. Zend_Validate::setMessageLength(100);
  589. ]]></programlisting>
  590. <note>
  591. <para>
  592. Notez que la taille des messages affecte aussi les messages personnalisés enregistrés,
  593. si le validateur considéré étend <classname>Zend_Validate_Abstract</classname>.
  594. </para>
  595. </note>
  596. </sect2>
  597. </sect1>
  598. <!--
  599. vim:se ts=4 sw=4 et:
  600. -->