Home > php教程 > PHP开发 > body text

Usage example of jquery form validation plug-in in Yii framework

高洛峰
Release: 2016-12-20 15:07:18
Original
1028 people have browsed it

The example in this article describes the usage of jquery form validation plug-in in Yii framework. Share it with everyone for your reference, the details are as follows:

The running effect diagram is as follows:

Usage example of jquery form validation plug-in in Yii framework

View layer:




  
  
  
  
  
  
  

注册页面

注意:如果没有勾选“我乐意接收新信息”以下选项会隐藏,但我们这里作为演示让它可见

Copy after login

Controller (verify uniqueness):

//验证姓名唯一性
public function actionOnly(){
  $u_name=Yii::$app->request->get('u_name');
  $login=Yii::$app->db;
  //查询数据
  $sql="select * from login where u_name='$u_name'";
  $res=$login->createCommand($sql)->execute();
  if($res)
  {
    echo false;
  }
  else
  {
    echo true;
  }
}
Copy after login



I hope this article will be helpful Our PHP programming based on the Yii framework is helpful.

For more related articles about jquery form validation plug-in usage examples in the Yii framework, please pay attention to the PHP Chinese website!

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!