新人求教,thinkphp框架自动验证有关问题

WBOY
Release: 2016-06-13 12:08:38
Original
808 people have browsed it

新人求教,thinkphp框架自动验证问题!
thinkphp框架中的自动验证功能,验证规则有一个function选项,“function 函数验证,定义的验证规则是一个函数名 ”
代码如下:
 array('password','checkPwd','密码格式不正确',0,'function'), // 自定义函数验证密码格式

请问这个checkPwd函数要定义在哪?
------解决思路----------------------
 放在MODEL层里面。
------解决思路----------------------
checkPwd 不是公共的函数,放在你这个类的文件里就可以了
------解决思路----------------------
显然需要你自己写,这个只是个例子。
------解决思路----------------------
就在你这个model文件下面定义这个函数....

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!