Yii Interview Questions and Answers
The Best LIVE Mock Interview - You should go through before Interview
Freshers / Beginner level questions & answers
Ques 1. What is Yii?
Yii is a high-performance PHP framework for developing web applications.
Example:
// Yii::app()->run();
Is it helpful?
Add Comment
View Comments
Ques 2. Explain Yii's Gii tool.
Gii is a web-based code generation tool provided by Yii that helps in quickly generating code for models, controllers, forms, and more.
Example:
http://your-app/index.php?r=gii
Is it helpful?
Add Comment
View Comments
Ques 3. How does Yii handle form validation?
Yii uses model-based form validation. You define validation rules in the model, and Yii automatically validates input data against these rules.
Example:
// public function rules() { return array('username, password', 'required'); }
Is it helpful?
Add Comment
View Comments
Ques 4. How to handle form submissions in Yii?
You can handle form submissions in Yii by using the CActiveForm widget and processing the form data in the controller action.
Example:
// if(isset($_POST['Model'])) { $model->attributes=$_POST['Model']; if($model->save()) { // success action } }
Is it helpful?
Add Comment
View Comments
Most helpful rated by users: