Home > Article > Backend Development > jquery form validation plug-in usage example in Yii framework_php example
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 operation effect diagram is as follows:
View layer:
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; } }
Readers who are interested in more Yii-related content can check out the special topics on this site: "Introduction to Yii Framework and Summary of Common Techniques", "Summary of Excellent PHP Development Framework", "Basic Tutorial for Getting Started with Smarty Templates", "Introduction to PHP Object-Oriented Programming" Tutorial", "php string (string) usage summary", "php+mysql database operation introductory tutorial" and "php common database operation skills summary"
I hope this article will help you design PHP programs based on the Yii framework.