Yii PHP Framework Multiple-Choice Questions (MCQs)

Yii is an open source, object-oriented, component-based MVC PHP web application framework.

Yii PHP Framework MCQs: This section contains multiple-choice questions and answers on the various topics of Yii PHP Framework. Practice these MCQs to test and enhance your skills on Yii PHP Framework.

List of Yii PHP Framework MCQs

1. Yii is a ____ framework.

  1. PHP
  2. JavaScript
  3. Python
  4. Java

Answer: A) PHP

Explanation:

Yii is a PHP framework.

Discuss this Question


2. Which architecture does the Yii framework follows?

  1. MVVM
  2. MVC
  3. MVP

Answer: B) MVC

Explanation:

Yii framework follows MVC architecture.

Discuss this Question


3. Is Yii framework purely object-oriented?

  1. Yes
  2. No

Answer: A) Yes

Explanation:

Yes, Yii framework is purely object-oriented.

Discuss this Question


4. Is the Yii framework an open-source framework?

  1. Yes
  2. No

Answer: A) Yes

Explanation:

Yii framework is an open-source framework.

Discuss this Question


5. Which code generation tool does Yii uses?

  1. Springboot
  2. CLI
  3. Code Igniters
  4. Gii

Answer: D) Gii

Explanation:

Gii is the code generation toolkit.

Discuss this Question


6. Does the Yii framework provides the feature of both RDBMS and NoSQL?

  1. Yes
  2. No

Answer: A) Yes

Explanation:

Yes, the Yii framework provides the feature of both RDBMS and NoSQL.

Discuss this Question


7. Data structures are represented, and mechanisms for accessing and altering data are provided by ____.

  1. View
  2. Controller
  3. Model

Answer: C) Model

Explanation:

Data structures are represented, and mechanisms for accessing and altering data are provided by the model.

Discuss this Question


8. ____ is responsible for presenting the user interface, including presentation logic and data presentation.

  1. View
  2. Controller
  3. Model

Answer: A) View

Explanation:

View is responsible for presenting the user interface, including presentation logic and data presentation.

Discuss this Question


9. ____ handles user requests and coordinates the model's and view's interaction.

  1. View
  2. Controller
  3. Model

Answer: B) Controller

Explanation:

The controller handles user requests and coordinates the model's and view's interaction.

Discuss this Question


10. The ____ folder contains all.js and.css files mentioned on the web page.

  1. Assets
  2. Config
  3. Model
  4. View

Answer: A) Assets

Explanation:

The assets folder contains all.js and.css files mentioned on the web page.

Discuss this Question


11. The ____ folder includes all of the third-party packages that Composer manages.

  1. Model
  2. Config
  3. Mail
  4. Vendor

Answer: D) Vendor

Explanation:

The vendor folder includes all of the third-party packages that Composer manages.

Discuss this Question


12. ____ are the greatest location to define global constants.

  1. Widgets
  2. Moules
  3. Entry Scripts
  4. Composer

Answer: D) Entry Scripts

Explanation:

Entry scripts are the greatest location to define global constants.

Discuss this Question


13. The constant ____ is used to enable or deactivate debugging in a Yii application.

  1. YII_ENV
  2. YII DEBUG
  3. YII_ENABLE_ERROR_HANDLER

Answer: B) YII DEBUG

Explanation:

The constant YII DEBUG is used to enable or deactivate debugging in a Yii application.

Discuss this Question


14. When the variable YII DEBUG is set to ____, the program displays detailed error messages.

  1. True
  2. False
  3. None

Answer: A) True

Explanation:

When the variable YII DEBUG is set to true, the program displays detailed error messages.

Discuss this Question


15. ____ is a constant that specifies the environment in which a Yii application runs, such as "development" or "production."

  1. YII_ENV
  2. YII DEBUG
  3. YII_ENABLE_ERROR_HANDLER

Answer: A) YII_ENV

Explanation:

YII ENV is a constant that specifies the environment in which a Yii application runs, such as "development" or "production."

Discuss this Question


16. When YII ENABLE ERROR HANDLER is set to ____, PHP's default error handling method is utilized.

  1. True
  2. False
  3. None

Answer: B) False

Explanation:

When YII ENABLE ERROR HANDLER is set to false, PHP's default error handling method is utilized.

Discuss this Question


17. Which of the following is the controller's default action, and is commonly used to show a list of records?

  1. ActionShow()
  2. Actioncreate()
  3. ActionView()
  4. ActionIndex()

Answer: D) ActionIndex()

Explanation:

actionIndex() is the controller's default action, and is commonly used to show a list of records.

Discuss this Question


18. You can view a single record in detail with ____ action.

  1. Viewaction()
  2. Actionsee()
  3. actionView()

Answer: C) Actionsee()

Explanation:

You can view a single record in detail with actionview () action.

Discuss this Question


19. ____ Action is used for setting a new record.

  1. CreateAction()
  2. actionCreateNew()
  3. actionNew()
  4. actionCreate()

Answer: D) actionCreate()

Explanation:

actionCreate() is used for setting a new record.

Discuss this Question


20. A ____ in Yii is a mapping between a URL pattern and a controller action.

  1. Templating engine
  2. Route
  3. Controller
  4. Composer

Answer: B) Route

Explanation:

A route in Yii is a mapping between a URL pattern and a controller action.

Discuss this Question


21. Action ID can contain ____.

  1. English letter in lowercase
  2. Digits
  3. Hyphens
  4. Underscores
  5. All of the above

Answer: E) All of the above

Explanation:

Action ID can contain:

  • English letter in lowercase
  • Digits
  • Hyphens
  • Underscores

Discuss this Question


22. How many types of actions are there in the Yii framework?

  1. 5
  2. 4
  3. 3
  4. 2

Answer: D) 2

Explanation:

Two types of actions are there in the Yii framework: Inline and standalone.

Discuss this Question


23. Which of the following action is defined in the controller class?

  1. Inline
  2. Standalone

Answer: A) Inline

Explanation:

Inline actions are defined in the controller class.

Discuss this Question


24. In the Yii framework, an ____ method is a public method in a controller class that is in charge of processing a request and creating a response.

  1. Model
  2. Controller
  3. Action

Answer: C) Action

Explanation:

In the Yii framework, an action method is a public method in a controller class that is in charge of processing a request and creating a response.

Discuss this Question


25. A ____ is a class in the Yii framework that represents a data item and specifies the logic for communicating with data storage, such as a database.

  1. Model
  2. Controller
  3. Action

Answer: A) Model

Explanation:

A model is a class in the Yii framework that represents a data item and specifies the logic for communicating with data storage, such as a database.

Discuss this Question


26. Which of the following method updates data in the data store based on the circumstances stated?

  1. Update()
  2. UpdateAll()
  3. Validate()

Answer: B) UpdateAll()

Explanation:

UpdateAll() method, Updates data in the data store based on the circumstances stated.

Discuss this Question


27. In the Yii framework, ____ are used to describe which properties of a model should be evaluated during validation.

  1. Possibilities
  2. Events
  3. Cases
  4. Scenarios

Answer: D) Scenarios

Explanation:

In the Yii framework, scenarios are used to describe which properties of a model should be evaluated during validation.

Discuss this Question


28. A ____ is a piece of reusable client-side programming that includes HTML, CSS, and JS.

  1. View
  2. Widget
  3. Template

Answer: B) Widget

Explanation:

A widget is a piece of reusable client-side programming that includes HTML, CSS, and JS.

Discuss this Question


29. To utilize a widget, we use which of the following method?

  1. Widget ()
  2. Wid()
  3. Use_widget()

Answer: A) Widget()

Explanation:

To utilize a widget, use the "widget ()" function.

Discuss this Question


30. ____ are mini-applications that may be inserted into the main application and contain their controllers, models, views, and assets.

  1. Units
  2. Modules
  3. Components
  4. Template

Answer: B) Modules

Explanation:

Modules are mini-applications that may be inserted into the main application and contain their controllers, models, views, and assets.

Discuss this Question


31. When the module is being initialized, which of the following method is invoked?

  1. Initialized ()
  2. Start ()
  3. New ()
  4. Init ()

Answer: D) Init ()

Explanation:

When the module is being initialized, Init () method is invoked.

Discuss this Question


32. Which of the following function returns the module to which a component belongs?

  1. getModules()
  2. get()
  3. getModule()

Answer: C) getModule()

Explanation:

getModule() function returns the module to which a component belongs.

Discuss this Question


33. Which of the following function returns an array of all the modules declared in the application?

  1. getModules()
  2. get()
  3. getModule()

Answer: A) getModules()

Explanation:

getModules () function returns an array of all the modules declared in the application.

Discuss this Question


34. Is getModules () and getModule () both are same?

  1. Yes
  2. No

Answer: B) No

Explanation:

No, they are not the same, getModules () function returns an array of all the modules declared in the application, whereas the getModule() function returns the module to which a component belongs.

Discuss this Question


35. To render a view, ____ method is implemented.

  1. Render ()
  2. Use ()
  3. Display ()
  4. Create ()

Answer: A) Render ()

Explanation:

To render a view, the render() method is implemented.

Discuss this Question


36. ____ function is used to render a partial view, which is a view piece that may be reused across numerous pages.

  1. Render_limited()
  2. LimitedRender()
  3. renderPartial()

Answer: C) renderPartial()

Explanation:

renderPartial() function is used to render a partial view, which is a view piece that may be reused across numerous pages.

Discuss this Question


37. ____ in the Yii framework are static files such as JavaScript, CSS, pictures, and fonts that are used to improve an application's visual and interactive characteristics.

  1. Template
  2. Static
  3. Component
  4. Assets

Answer: D) Assets

Explanation:

Assets in the Yii framework are static files such as JavaScript, CSS, pictures, and fonts that are used to improve an application's visual and interactive characteristics.

Discuss this Question


38. ____ are third-party components that offer new features to your program.

  1. Extension
  2. Plugin
  3. Extender

Answer: A) Extension

Explanation:

Extension are third-party components that offer new features to your program.

Discuss this Question


39. Which of the following HTTP method is used to gather data without altering it in any way?

  1. GET
  2. POST
  3. PUT
  4. PATCH

Answer: A) GET

Explanation:

GET HTTP method is used to gather data without altering it in any way.

Discuss this Question


40. Which of the following HTTP method is employed in the creation of new resources as well as the update of current ones?

  1. GET
  2. POST
  3. PUT

Answer: B) POST

Explanation:

POST HTTP method is employed in the creation of new resources as well as the update of current ones.

Discuss this Question


41. Which of the following function is used to generate URLs for a certain activity?

  1. CreateURL()
  2. NewURL()
  3. InitURL()

Answer: A) CreateURL()

Explanation:

CreateURL() function is used to generate URLs for a certain activity.

Discuss this Question


42. Suppose you want to add new URL rules to the URL manager component, then which of the following method you will use?

  1. Rules_new()
  2. New_Rules()
  3. AddRules()

Answer: C) AddRules()

Explanation:

addRules() method, add new URL rules to the URL manager component.

Discuss this Question


43. ____ function generates the form's opening element and returns the HTML code for it.

  1. beginForm()
  2. endForm()
  3. Form()

Answer: A) beginForm()

Explanation:

beginForm() function generates the form's opening element and returns the HTML code for it.

Discuss this Question


44. ____ in the Yii framework is the process of determining if user-submitted data fits the needed criteria before it is stored in a database or utilized for other reasons.

  1. Authentication
  2. Data Validation
  3. Authorization
  4. Ad-hoc validation

Answer: B) Data Validation

Explanation:

Data validation in the Yii framework is the process of determining if user-submitted data fits the needed criteria before it is stored in a database or utilized for other reasons.

Discuss this Question


45. ____ are the classes that really do the validation.

  1. Controllers
  2. Model
  3. Validators

Answer: C) Validators

Explanation:

Validators are the classes that do the validation.

Discuss this Question


46. Validation is performed on a model using which of the following function?

  1. Check ()
  2. Confirm ()
  3. Validation ()
  4. Validate()

Answer: D) Validate()

Explanation:

Validation is performed on a model using the validate() function.

Discuss this Question


47. ____ in Yii framework refers to the process of verifying data without the use of a model.

  1. Authentication
  2. Data Validation
  3. Authorization
  4. Ad-hoc validation

Answer: D) Ad-hoc validation

Explanation:

Ad-hoc validation in the Yii framework refers to the process of verifying data without the use of a model.

Discuss this Question


48. How many types of custom validators are there in the Yii framework?

  1. 2
  2. 3
  3. 4
  4. 5

Answer: A) 2

Explanation:

There are two types of custom validators: Inline and standalone.

Discuss this Question


49. ____ is a feature in the Yii framework that allows you to validate form data on the client side using JavaScript and AJAX calls without having to reload the page.

  1. Authentication
  2. Data Validation
  3. AJAX Validation
  4. Ad-hoc validation

Answer: C) AJAX Validation

Explanation:

AJAX validation is a feature in the Yii framework that allows you to validate form data on the client side using JavaScript and AJAX calls without having to reload the page.

Discuss this Question


50. In the Yii framework, a ____ is a technique of storing data that is persistent over numerous requests.

  1. Session
  2. Cookies
  3. Response
  4. Request

Answer: A) Session

Explanation:

In the Yii framework, a session is a technique for storing data that is persistent over numerous requests.

Discuss this Question


51. ____ is a transient data storage technique in the Yii framework that may be used to transfer messages or data between requests.

  1. Persistent storage
  2. Cache
  3. Flash data

Answer: C) Flash data

Explanation:

Flash data is a transient data storage technique in the Yii framework that may be used to transfer messages or data between requests.

Discuss this Question


52. ____ are simple text files that are kept on the client side.

  1. Session
  2. Cookies
  3. Response
  4. Request

Answer: B) Cookies

Explanation:

Cookies are simple text files that are kept on the client side.

Discuss this Question


53. In the Yii framework, a ____ is a component that supplies data for a view, such as a grid view or list view.

  1. Storage
  2. Event
  3. Data widget
  4. Data provider

Answer: D) Data provider

Explanation:

In the Yii framework, a data provider is a component that supplies data for a view, such as a grid view or list view.

Discuss this Question


54. The ____ widget receives data from a data source and displays it as a table.

  1. ListView
  2. GridView
  3. TemplateView

Answer: B) GridView

Explanation:

The GridView widget receives data from a data source and displays it as a table.

Discuss this Question


55. A ____ is an entity that knows how to create and configure objects.

  1. Dependency injection
  2. Database access object
  3. Data widget

Answer: A) Dependency injection

Explanation:

A DI container (dependency injection) is an entity that knows how to create and configure objects.

Discuss this Question


56. What is DAO in Yii?

  1. Data access oriented
  2. Data active object
  3. Data access object

Answer: C) Data access object

Explanation:

DOA stands for data access object.

Discuss this Question


57. Which of the following databases does DOA supports?

  1. MySQL
  2. MSSQL
  3. SQLite
  4. MariaDB
  5. All of the above

Answer: E) All of the above

Explanation:

Following databases are supported by DOA:

  • MySQL
  • MSSQL
  • SQLite
  • MariaDB
  • PostgreSQL
  • ORACLE
  • CUBRID

Discuss this Question


58. Yii ____ allows you to add more functionality to an object without changing its code.

  1. Activity
  2. Behaviours
  3. Active data

Answer: B) Behaviours

Explanation:

Yii behaviors allow you to add more functionality to an object without changing its code.

Discuss this Question


59. Which of the following lets you generate SQL queries programmatically?

  1. DOA
  2. Query Composer
  3. Query Generator
  4. Query builder

Answer: D) Query builder

Explanation:

The query builder lets you generate SQL queries programmatically.

Discuss this Question


60. Which NoSQL DB does the Active record class support?

  1. Redis
  2. Mongo
  3. Both
  4. Only A
  5. Only B

Answer: C) Both

Explanation:

Active record class support following NoSQL DB:

  1. Redis
  2. Mongo

Discuss this Question


61. Which of the following are the main component of DOA?

  1. Data provider
  2. Query
  3. Active record
  4. Command
  5. All of the above

Answer: E) All of the above

Explanation:

Following are the main component of DOA:

  • Data provider
  • Query
  • Active record
  • Command

Discuss this Question


62. Which of the following API Clears the cache of all data values?

  1. Delete()
  2. Del()
  3. Flush()

Answer: C) Flush()

Explanation:

Flush () clears the cache of all data values.

Discuss this Question


63. An alias begins with the ____ symbol.

  1. ~
  2. @
  3. $
  4. _

Answer: B) @

Explanation:

An alias begins with the @ symbol.

Discuss this Question


64. Does the Yii framework has a built-in error-handling feature?

  1. Yes
  2. No

Answer: A) Yes

Explanation:

Yes, the Yii framework has a built-in error-handling feature.

Discuss this Question


65. ____ refers to the process of validating a user's identity.

  1. Localization
  2. Globalization
  3. Authorisation
  4. Authentication

Answer: D) Authentication

Explanation:

Authentication refers to the process of validating a user's identity.

Discuss this Question


66. What is ACF in the Yii framework?

  1. Active control feature
  2. Access control filter
  3. Active control filter

Answer: B) Access control filter

Explanation:

ACF stands for access control filter

Discuss this Question


67. The process of determining whether a user has sufficient authority to accomplish something is known as ____.

  1. Localization
  2. Globalization
  3. Authorisation
  4. Authentication

Answer: C) Authorisation

Explanation:

The process of determining whether a user has sufficient authority to accomplish something is known as authorization.

Discuss this Question




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.