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
111. Which authentication method in Yii involves verifying user credentials using a username and password?
A. HTTP Basic Authentication
B. OAuth 2.0
C. JWT (JSON Web Tokens)
D. OAuth 1.0a
Show Answer
Report This Question
Answer: HTTP Basic Authentication
112. In Yii, what is the primary role of RBAC (Role-Based Access Control) in authorization?
A. Assigning roles to users
B. Authenticating users
C. Handling database connections
D. Managing server routes
Show Answer
Report This Question
Answer: Assigning roles to users
113. Which Yii component is used for managing user sessions and storing user authentication status?
A. CWebUser
B. CActiveRecord
C. CGridView
D. CListView
Show Answer
Report This Question
Answer: CWebUser
114. In Yii's RBAC, what is a role typically associated with?
A. Permissions and access rules
B. Database tables and queries
C. Controller actions and view templates
D. Authentication credentials
Show Answer
Report This Question
Answer: Permissions and access rules
115. What does the accessControl filter in Yii allow you to do?
A. Define access rules for controller actions
B. Authenticate users
C. Create RESTful routes
D. Render HTML templates
Show Answer
Report This Question
Answer: Define access rules for controller actions
116. In Yii, what is the purpose of the authManager component?
A. Managing RBAC permissions and roles
B. Handling HTTP requests
C. Displaying user interfaces
D. Configuring database connections
Show Answer
Report This Question
Answer: Managing RBAC permissions and roles
117. Which Yii extension is commonly used for implementing OAuth 2.0 authentication in RESTful applications?
A. yiisoft/yii2-oauth2
B. yiisoft/yii2-auth
C. yiisoft/yii2-rest
D. yiisoft/yii2-security
Show Answer
Report This Question
Answer: yiisoft/yii2-oauth2
118. What is the purpose of JWT (JSON Web Tokens) in Yii's authentication system?
A. Securely transmitting authentication data
B. Storing user credentials
C. Generating random tokens
D. Managing server routes
Show Answer
Report This Question
Answer: Securely transmitting authentication data
119. How can you restrict access to a specific action in a Yii controller to authenticated users only?
A. Using the accessControl filter
B. Configuring database tables
C. Defining custom HTTP headers
D. Redirecting to external authentication
Show Answer
Report This Question
Answer: Using the accessControl filter
120. What is Yii's default behavior when an unhandled exception occurs in a RESTful API request?
A. Displaying a detailed error message
B. Redirecting to the home page
C. Logging the error and continuing execution
D. Terminating the request with an error response
Show Answer
Report This Question
Answer: Displaying a detailed error message