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.
71. What is the main advantage of using Yii's Active Record over traditional SQL queries?
Answer:Abstraction of database access details
72. What Yii method is used to create a new record in the database using Active Record?
73. In Yii, how can you specify the fields to be inserted or updated when using Active Record?
Answer:Define attributes in the model class
74. What is the purpose of the 'findByAttributes' method in Yii's Active Record?
Answer:Retrieve a record based on specified attributes
75. In Yii's Active Record, what method is used to retrieve a single record by its primary key?
76. What is the primary purpose of using 'scopes' in Yii's Active Record?
Answer:Defining reusable query conditions
77. In Yii, how can you perform a query that returns multiple records using Active Record?
78. What is the difference between 'findAll()' and 'find()' methods in Yii's Active Record?
Answer:'findAll()' returns an array of all records, 'find()' returns a single record.
79. In Yii's Active Record, what method is commonly used to delete a record from the database?
80. What is the primary purpose of RESTful routing in Yii?
Answer:Mapping URLs to controller actions
Yii Interview questions and answers Yii MCQ Yii Framework MCQ Practice Test Yii Interview questions and answers PDF