240+ PHP Yii Framework MCQ With Online Practice Test

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.

Practice Test

61. In Yii, which configuration parameter specifies the database system used for the application?

Answer: 'dbType'

62. What is the purpose of the 'dsn' (Data Source Name) in Yii's database configuration?

Answer: It specifies the connection details, including the database type and server address.

63. In Yii's database configuration, what is typically included in the 'dsn' parameter for MySQL?

Answer: 'mysql:host=localhost;dbname=mydatabase'

64. What Yii configuration parameter specifies the username for accessing the database server?

Answer: 'username'

65. In Yii's database configuration, what is the purpose of specifying a 'password' parameter?

Answer: It provides the password for the database user.

66. What Yii configuration parameter specifies the charset used for database communication?

Answer: 'charset'

67. In Yii's database configuration, what is the primary purpose of specifying a 'tablePrefix'?

Answer: It adds a prefix to table names for avoiding naming conflicts.

68. In Yii, what is the purpose of the 'enableSchemaCache' configuration parameter?

Answer: It enables caching of the database schema for improved performance.

69. What Yii configuration parameter is used to specify the duration of the database schema cache?

Answer: 'schemaCacheDuration'

70. In Yii, what is Active Record primarily used for?

Answer: Database operations and data modeling
Topic Tags
Yii Interview questions and answers Yii MCQ Yii Framework MCQ Practice Test Yii Interview questions and answers PDF