Yii is a high-performance, open-source PHP framework renowned for its efficiency and versatility in web application development. Launched in 2008, Yii (pronounced "yee") has gained a strong following among developers worldwide. It boasts a robust set of features, including a powerful extension system, seamless integration of third-party libraries, and comprehensive tools for handling security and scalability. With its emphasis on clean, maintainable code and rapid development, Yii is an excellent choice for building web applications of varying complexities, from simple websites to intricate enterprise solutions.
Show All Answers
Practice Test
11. Which of the following tools is commonly used for installing Yii packages and dependencies?
A. Composer
B. npm (Node Package Manager)
C. pip (Python Package Manager)
D. RubyGems
Show Answer
Report This Question
Answer: Composer
12. In Yii 2, which configuration file is used to set up application-wide parameters and components?
A. config/web.php
B. index.php
C. models/config.php
D. php.ini
Show Answer
Report This Question
Answer: config/web.php
13. What is the recommended web server for running Yii applications in a production environment?
A. Nginx
B. Apache
C. IIS
D. Tomcat
Show Answer
Report This Question
Answer: Nginx
14. To create a new Yii application using the Yii 2 advanced template, which command should you use?
A. composer create-project --prefer-dist yiisoft/yii2-app-advanced
B. yii create-app advanced
C. php init
D. yii2 new-app advanced
Show Answer
Report This Question
Answer: composer create-project --prefer-dist yiisoft/yii2-app-advanced
15. What is the purpose of the yiic command in Yii 1.x for code generation and console tasks?
A. It is the Yii 1.x console command-line tool for various tasks such as generating code and running migrations.
B. It is a PHP built-in function for rendering views.
C. It is the Yii 1.x web application configuration file.
D. It is a PHP extension for database connection.
Show Answer
Report This Question
Answer: It is the Yii 1.x console command-line tool for various tasks such as generating code and running migrations.
16. Which directory typically stores the application-specific code and controllers in Yii 2 advanced template?
A. frontend
B. backend
C. common
D. config
Show Answer
Report This Question
Answer: frontend
17. To enable the URL manager in Yii for cleaner and more user-friendly URLs, what configuration step is necessary?
A. Modifying the .htaccess file to enable URL rewriting
B. Configuring the web server to allow clean URLs
C. Running the yiic urlmanager command
D. Adding URL patterns to the web.php configuration file
Show Answer
Report This Question
Answer: Configuring the web server to allow clean URLs
18. In Yii, what is the purpose of the environments directory in the advanced template?
A. It contains environment-specific configuration files for development and production environments.
B. It stores third-party JavaScript libraries.
C. It holds generated assets and runtime files.
D. It is the default location for controller classes.
Show Answer
Report This Question
Answer: It contains environment-specific configuration files for development and production environments.
19. Which of the following databases is NOT supported out-of-the-box by Yii 2?
A. MongoDB
B. MySQL
C. PostgreSQL
D. SQLite
Show Answer
Report This Question
Answer: MongoDB
20. What does "MVC" stand for in the context of software architecture, including Yii?
A. Model-View-Controller
B. Model-Validation-Controller
C. Model-View-Component
D. Model-Validation-Component
Show Answer
Report This Question
Answer: Model-View-Controller