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
61. In Yii, which configuration parameter specifies the database system used for the application?
A. 'class'
B. 'dsn'
C. 'dbType'
D. 'dbClass'
Show Answer
Report This Question
Answer: 'dbType'
62. What is the purpose of the 'dsn' (Data Source Name) in Yii's database configuration?
A. It specifies the connection details, including the database type and server address.
B. It defines the database schema.
C. It controls the database caching mechanism.
D. It configures the view file extension.
Show Answer
Report This Question
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?
A. 'mysql:host=localhost;dbname=mydatabase'
B. 'sqlite:mydatabase.db'
C. 'pgsql:host=localhost;dbname=mydatabase'
D. 'oci8:host=localhost;dbname=mydatabase'
Show Answer
Report This Question
Answer: 'mysql:host=localhost;dbname=mydatabase'
64. What Yii configuration parameter specifies the username for accessing the database server?
A. 'username'
B. 'user'
C. 'dbUser'
D. 'dbUsername'
Show Answer
Report This Question
Answer: 'username'
65. In Yii's database configuration, what is the purpose of specifying a 'password' parameter?
A. It provides the password for the database user.
B. It defines the primary key for database tables.
C. It sets the database encoding.
D. It controls the layout structure.
Show Answer
Report This Question
Answer: It provides the password for the database user.
66. What Yii configuration parameter specifies the charset used for database communication?
A. 'charset'
B. 'dbCharset'
C. 'encoding'
D. 'dbEncoding'
Show Answer
Report This Question
Answer: 'charset'
67. In Yii's database configuration, what is the primary purpose of specifying a 'tablePrefix'?
A. It adds a prefix to table names for avoiding naming conflicts.
B. It defines the primary key for database tables.
C. It controls the URL routing.
D. It configures the authentication method.
Show Answer
Report This Question
Answer: It adds a prefix to table names for avoiding naming conflicts.
68. In Yii, what is the purpose of the 'enableSchemaCache' configuration parameter?
A. It enables caching of the database schema for improved performance.
B. It specifies the location of view files.
C. It controls user authentication.
D. It defines RESTful routes.
Show Answer
Report This Question
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?
A. 'schemaCacheDuration'
B. 'cacheDuration'
C. 'dbCacheDuration'
D. 'cacheTime'
Show Answer
Report This Question
Answer: 'schemaCacheDuration'
70. In Yii, what is Active Record primarily used for?
A. Database operations and data modeling
B. User authentication
C. URL routing and RESTful API development
D. Templating and layout rendering
Show Answer
Report This Question
Answer: Database operations and data modeling