Home >Backend Development >PHP Tutorial >php framework - When thinkPHP uses function to automatically verify, can it call back an error message?

php framework - When thinkPHP uses function to automatically verify, can it call back an error message?

WBOY
WBOYOriginal
2016-07-06 13:52:561105browse

<code>array('user', 'checkLength', '用户名必须在 3-5 位', 0, 'function', 3,array(3,5)),</code>

Can this 'username must be between 3-5 characters' passed out from function checkLength()?

Reply content:

<code>array('user', 'checkLength', '用户名必须在 3-5 位', 0, 'function', 3,array(3,5)),</code>

Can this 'username must be between 3-5 characters' passed out from function checkLength()?

Verify that the length tp is written

<code>array('user','3,5','用户名必须在 3-5 位',0,'length',3), //验证字符长度</code>

What is the use of sending it? This error is triggered $model->getError(); You can get it

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn