Yii Interview Questions and Answers

Q1. What is Yii Framework?

Ans. Yii stands for “Yes it is” and this is a framework of PHP and this is built on PHP Programming language. Yii Framework based on MVC (Model View Controller) Structure and this is one best framework of PHP use of you can develop all types of project such as- E commerce, CRM (Customer relationship management), Portal Like, Taxi Mobility type and Blogging an all that. Yii framework based on ORM (Object Relational Mapping) Model.

Q2. What is GII in Yii Framework?

Ans. GII is one the tool in Yii and that is very helpful tool for all Yii developers and Gii also known as CRUD. Yii Developers developing and design a project very quickly use of CRUD tool and you can generate a module or controller or model or views individually. According to other PHP framework Yii is best.

Q3. What is current version of Yii?

Ans. Yii current version is 2.0.11 is released now.

Q4. How to manage dependencies in Yii?

Ans. In Yii, You can manage all dependencies by using Composer.

Q5. How to Request data in Yii?

Ans. Here, I’m going to describe measure functions for getting request a data in Yii.
Yii::$app->getRequest();
Yii::$app->getRequest()->post();
//for getting post request
Yii::$app->getRequest()->get(); 
//for getting get request

Q6. How to get current action name in Yii?

Ans. Yii::$app->controller->action->id

Q7. How to get current URL in Yii?

Ans. Yii::$app->request->getUrl()

Q8. What is difference between “Render” and “Renderpartial” in Yii ?

Ans. The Render is used for loading view with layout whereas Renderpartial is load only a view data not a layout. When you are using AJAX request and you want a getting some peace of data or HTML code then you getting a problem with $this->render() function because this function includes a layout here with your define code then you need use here $this->renderpartial() function.

Q9. List some database related functions in Yii 2 Framework?

Ans. Here, i’m going to defile all this functions so that use for querying in Yii.

  • find()
  • findAll()
  • insert()
  • save()
  • update()
  • updateAll()
  • delete()
  • deleteAll()
News Reporter
IT Software and web development, Core PHP, JavaScript, JQuery, HTML, CSS, CakePHP, Angularjs, Codeigniter etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

error: