Yii Interview Questions and Answers – Part 4

31. List out some database related functions in Yii?
Query, find, findAll , findByPk , find By

32. How to include a javascript menu through a site?
We can include by adding the javascript files in webroot and then call them in default views if they are needed everywhere or in the related views.

33. Who was the developer of the Yii and when was it build?
The developer of the Yii is Yii Software LLC. It was started in the year 2008 in December 3, with the version of 1.0 and continued to 1.1.13. in PHP language.

34. How does Yii Compare with Other Frameworks?
Comparatively to most of PHP frameworks, Yii is a MVC framework. Yii bests PHP frameworks for its efficient, feature-rich and clearly-documented. Yii is designed to be fit for serious Web application development. It is neither a consequence of some project nor a corporation of third-party work.

35. How do we extend Yii?
Extending Yii is a common action during web development. Like when we write a new controller, we extend Yii by inheriting its CController class; when we write a new widget, we will extend CWidget or an existing class. If the code is designed to be reused by third-party then we call it an extension.

36. What is a Yiibase?
YiiBase is a helper class that serves functionalities of common framework. We should not use YiiBase directly. Instead, have to use its child class where we can customize the methods of YiiBase.

37. How to generate CRUD code?
After creating a model class file, we shall generate the code that implements the CRUD operations for user data. We choose the Crud Generator in Gii. In the model class field, we enter ‘User’. In the Controller ID field, we enter ‘user’ in lower case. Then press the preview button followed by the Generate button. Now we are done with the CRUD code generation.

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

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

3 − two =

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter