Yii MCQ Questions
11. Which of the following is not a feature of Yii?
A. Yii implements the MVC architectural pattern
B. It is extremely extensible.
C. Yii provides single-tier caching support.
D. Yii provides RESTful API development support.
View Answer
Ans : C
Explanation: Yii provides multi-tier caching support.
12. Which folder contains all the third-party packages managed by Composer?
A. Vendor
B. Views
C. Web
D. Config
View Answer
Ans : A
Explanation: Vendor : This folder contains all the third-party packages managed by Composer.
13. The global constants should be defined at the __________ of an entry script.
A. end
B. beginning
C. middle
D. anywhere in the script
View Answer
Ans : B
Explanation: The global constants should be defined at the beginning of an entry script in order to take effect when other PHP files are included.
14. A ________ is a reusable client-side code, which contains HTML, CSS, and JS.
A. Widget
B. Models
C. Modules
D. Views
View Answer
Ans : A
Explanation: A widget is a reusable client-side code, which contains HTML, CSS, and JS. This code includes minimal logic and is wrapped in a yiiaseWidget object.
15. To use a widget in a View, you should call the yiiaseWidget::widget() function.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, To use a widget in a View, you should call the yiiaseWidget::widget() function.
16. Yii manages assets in ?
A. asset blocks
B. asset views
C. asset trigger
D. asset bundles
View Answer
Ans : D
Explanation: An asset is a file (css, js, video, audio or image, etc.) that may be referenced in a web page. Yii manages assets in asset bundles.
17. Which assestbundles Includes the yii.js file?
A. yiiwebJqueryAsset
B. yiiwebYiiAsset
C. yiiootstrapBootstrapAsset
D. yiijuiJuiAsset
View Answer
Ans : B
Explanation: yiiwebYiiAsset : Includes the yii.js file, which implements a mechanism of organizing JS code in modules
18. when you write a new widget, which class you are extending?
A. Widget
B. CWidget
C. CForm
D. CControl
View Answer
Ans : B
Explanation: when you write a new widget, which class you are extending Cwidget.
19. To access a database table, we first need to define an AR class by extending
A. CActive
B. ActiveRecord
C. CController
D. CActiveRecord
View Answer
Ans : D
Explanation: To access a database table, we first need to define an AR class by extending CActiveRecord.
20. Cookies are plain text files stored on the client side.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Cookies are plain text files stored on the client side. You can use them for tracking purpose.
Discussion