FuelPHP is a free, open source framework that provides ready-to-use frontend components that you can easily combine to build responsive web interfaces.
FuelPHP MCQs: This section contains multiple-choice questions and answers on the various topics of FuelPHP. Practice these MCQs to test and enhance your skills on FuelPHP.
List of FuelPHP MCQs
1. Is FuelPHP open-source?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, FuelPHP is free and open-source.
2. FuelPHP is written in which of the following language?
- Python
- C++
- PHP
- JavaScript
Answer: C) PHP
Explanation:
FuelPHP is written in PHP language.
3. Which of the following architecture does FuelPHP follow?
- MVC
- MVP
- HMVC
Answer: C) HMVC
Explanation:
FuelPHP follows HMVC architecture i.e., Hierarchical Model-View-Controller.
4. Does FuelPHP follow object-oriented concepts?
- Yes
- No
Answer: A) Yes
Explanation:
FuelPHP is purely an object-oriented approach.
5. ____ is a meta-programming technique used to create database operations?
- Scaffolding
- Shell
- Kroobe
Answer: A) Scaffolding
Explanation:
Scaffolding is a meta-programming technique used to create database operations.
6. ____ is a command line program that may be used to aid speed up development?
- CLI
- Oil
- CommandI
- All of the above
Answer: B) Oil
Explanation:
Oil is a command line program that may be used to aid speed up development.
7. ____ is the business entity of the application?
- View
- Model
- Controller
Answer: B) Model
Explanation:
The model is the business entity of the application.
8. ____ is the presentation layer of the MVC application?
- View
- Model
- Controller
Answer: A) View
Explanation:
View is the presentation layer of the MVC application.
9. The ____ class serves as an object wrapper for “views,” abstracting all view code away from the controller?
- View
- Model
- Controller
- Presenter
Answer: D) Presenter
Explanation:
The Presenter class serves as an object wrapper for “views,” abstracting all view code away from the controller.
10. Is the Package and module the same thing in FuelPHP?
- Yes
- No
Answer: B) NO
Explanation:
A Package is distinct from a Module in that it does not contain any web pages or partial web pages.
11. Suppose you want to create a new project named as a student in FuelPHP then which of the following commands would you use?
- Create Student
- Oil create project Student
- Create project student
- Oil create student
Answer: D) Oil create student
Explanation:
Oil create student would be the correct command.
12. Which of the following folders in FuelPHP contains all the PHP files?
- Public
- Fuel
- Oil
- Views
Answer: B) Fuel
Explanation:
The fuel folder contains all the PHP files.
13. Which of the following folders contains all assets that can be accessed directly through the browser, such as JavaScript, CSS, pictures, and so on?
- Public
- Static
- Oil
- Views
Answer: A) Public
Explanation:
Public folder contains all assets that can be accessed directly through the browser, such as JavaScript, CSS, pictures, and so on.
14. In which of the following folder/file Fuel framework itself lives?
- Fuel/app/config
- Fuel/config
- Fuel/core
- Fuel/packages
Answer: C) Fuel/core
Explanation:
The fuel/core folder/file is where the Fuel framework itself lives.
15. Which of the following controllers can be used to wrap your view in a layout with a header, footer, sidebar, etc?
- Base controller
- Template controller
- Rest controller
- Hybrid controller
Answer: B) Template controller
Explanation:
Template controller can be used to wrap your view in a layout with a header, footer, sidebar, etc.
16. Which of the following controllers has pre-defined support for REST API programming?
- Base controller
- Template controller
- Rest controller
- Hybrid controller
Answer: C) Rest controller
Explanation:
The rest controller has built-in functionality for REST API development.
17. The ____ controller combines the capabilities of the REST and Template controllers into a single base controller.
- Base controller
- Template controller
- Rest controller
- Hybrid controller
Answer: D) Hybrid controller
Explanation:
The hybrid controller combines the capabilities of the REST and Template controllers into a single base controller.
18. Error 404 is shown when ____?
- when HttpNoAccessException is found.
- when the page is not found.
- when HttpServerErrorException is found.
Answer: B) when the page is not found.
Explanation:
Error code 404 is displayed when the page is not found.
19. Error 500 is shown when ____?
- when HttpNoAccessException is found.
- when the page is not found.
- when HttpServerErrorException is found.
Answer: C) when HttpServerErrorException is found.
Explanation:
Error code 500 throws when HttpServerErrorException is found.
20. How many methods does the Request class in FuelPHP provide to get the details of the HTTP request?
- 4
- 5
- 3
- 2
Answer: C) 3
Explanation:
The request class provides three methods to get the details of the HTTP request. They are as follows:
- Active
- Param
- Params
21. Which of the following Request class method is a static method that returns the active HTTP request?
- Active
- Param
- Params
Answer: A) Active
Explanation:
Active method is a static method that returns the active HTTP request.
22. Which of the following Request class methods returns the value of the specified parameter?
- Active
- Param
- Params
Answer: B) Param
Explanation:
The param method returns the value of the specified parameter.
23. Which of the following Request class methods returns all the parameters as an array?
- Active
- Param
- Params
Answer: C) Params
Explanation:
Params Request class method returns all the parameters as an array.
24. How many arguments does the Response class provide in FuelPHP to create the HTTP response?
- 4
- 5
- 3
- 2
Answer: C) 3
Explanation:
The response class provides three arguments to create the HTTP response:
- $Body
- $status_code
- $headers
25. Which of the following Response class methods is the same as the response class constructor?
- Forge
- Redirect
- Set_status
- a.url
Answer: A) Forge
Explanation:
Forge Response class method is the same as the response class constructor.
26. Is the redirect and redirect_back method both the same?
- Yes
- No
Answer: B) NO
Explanation:
They are not the same, redirect_back method redirects to the previous page whereas, the redirect method is to a specific URL.
27. Which of the following methods offers an option to set the HTTP status code?
- Status
- Set
- Set_status
- Custom_status
Answer: C) Set_status
Explanation:
set_status method offers an option to set the HTTP status code.
28. Which of the following methods offers an option to set the HTTP headers?
- Setup_headers
- Set_header
- header
Answer: B) Set_header
Explanation:
set_header method offers an option to set the HTTP headers.
29. Among set_header and set_headers which of the following methods delivers an option to set multiple headers using an array?
- set_header
- set_headers
Answer: B) set_headers
Explanation:
set_headers method delivers an option to set multiple headers using an array.
30. Which of the following methods permits access to the previous set of header information?
- Previous_header
- Last_header
- Get_header
Answer: C) Get_header
Explanation:
get_header method permits access to the previous set of header information.
31. Which of the following separates the application logic from the presentation logic?
- View
- Controller
- Model
- Presenter
Answer: A) View
Explanation:
Views separate the application logic from the presentation logic.
32. set_global method in FuelPHP is a global method or a static method?
- Global
- Static
Answer: B) Static
Explanation:
set_global in FuelPHP is a static method.
33. Which of the following view methods gets the value of one or more variables?
- Get
- Get_var
- Var_get
Answer: A) Get
Explanation:
Get method to get the value of one or more variables.
34. Does FuelPHP support Nested views?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, FuelPHP supports nested views.
35. When the controller has finished processing the input and the business logic, it transmits the control to the ____?
- Model
- Presenter
- Launcher
Answer: B) Presenter
Explanation:
When the controller has finished processing the input and the business logic, it transmits the control to the Presenter.
36. Which of the following databases does FuelPHP support?
- MySQL
- MySQLi
- PDO.
- All of the above
Answer: D) All of the above
Explanation:
FuelPHP supports: MySQL, MySQLi, and PDO.
37. The ____ is the most basic way for an application to access a database?
- DB API
- DB QUERY
- DB CLASS
Answer: C) DB CLASS
Explanation:
The DB class is the most basic way for an application to access a database.
38. Which of the following DB class methods creates and returns the new Database_Connection instance?
- Instance
- Query
- Select
- Create
Answer: A) Instance
Explanation:
The instance DB class method creates and returns the new Database_Connection instance.
39. Suppose you want all the data from the table named as a student then which of the following syntax you will use?
- $query = DB:query(‘SELECT * FROM ‘student”);
- $query = DB::query(‘SELECT * FROM ‘student”);
- $query = ::query(‘SELECT * FROM ‘Student”);
Answer: B) DB::query(‘SELECT * FROM ‘student”);
Explanation:
$query = DB::query(‘SELECT * FROM ‘student”); is the correct syntax.
40. If you want to get the last executed query then which of the following DB class methods you will use?
- Previous_query
- Last
- Last_query
Answer: C) Last_query
Explanation:
The last_query method is used to get the last executed query.
41. Which of the following is the correct syntax to use for the update method?
- $query = DB::update(‘student’);
- $query = $DB:update(‘student’);
- $query = DB::$update(‘student’);
Answer: B) $query = $DB:update(‘student’);
Explanation:
$query = DB::update(‘student’); is the correct syntax.
42. Which of the following methods is used to set a variable to the parameter defined in the Query object?
- Data
- Select
- Bind
Answer: C) Bind
Explanation:
The bind method is used to set a variable to the parameter defined in the Query object.
43. The ____ class allows you to manage and conduct regular database operations?
- DB class
- Query builder API
- DBUtil
Answer: C) DBUtil
Explanation:
The DBUtil class allows you to manage and conduct regular database operations.
44. How many classes does FuelPHP provide to perform Form programming?
- 2
- 3
- 4
- 5
Answer: B) 3
Explanation:
FuelPHP provides three classes, Form, Fieldset, and Input, to perform Form programming.
45. Which of the following methods is used to create a new form?
- Open()
- New()
- Create()
Answer: A) Open()
Explanation:
Open() method is used to create a new form.
46. Which of the following methods simply closes the form?
- Del()
- Delete()
- End()
- Close()
Answer: D) Close()
Explanation:
Close() method simply closes the form.
47. Which of the following methods returns the HTTP protocol used in the request?
- Used_IP
- IP
- Protocol
- Used_protocol
Answer: C) Protocol
Explanation:
The protocol method returns the HTTP protocol used in the request.
48. ____ provides an object-oriented way to create a form?
- Fieldset
- Forms
- Inputs
Answer: A) Fieldset
Explanation:
Fieldset provides an object-oriented way to create a form.
49. Which of the following methods sets the initial value of the fields in the fieldset using a model instance?
- Model
- Populate
- Repopulate
- Validation
Answer: B) Populate
Explanation:
Populate method sets the initial value of the fields in the fieldset using model instances.
50. Which class in FuelPHP handles the uploading of files?
- Upload
- Load
- Get_load
- Up_load
Answer: A) Upload
Explanation:
The upload class in FuelPHP handles the uploading of files.
51. Which of the following methods determines whether the request is AJAX or not?
- Isajax
- Ajax_file
- Is_ajax
- Ajax_req
Answer: C) Is_ajax
Explanation:
is_ajax method determines whether the request is AJAX or not.
52. Which of the following methods allows you to build a new theme?
- Creates
- New
- Theme
- Instance
Answer: D) Instance
Explanation:
The instance method allows you to build a new theme.
53. Suppose you want to set the active theme then which of the following methods you would use?
- Set_active
- Active
- Use_active
Answer: B) Active
Explanation:
Active method is used to set the active theme.
54. ____ are an excellent method to create reusable online functionality such as a blog, album, chat, and so on?
- Presenter
- Themes
- Packages
- Modules
Answer: D) Modules
Explanation:
Modules are an excellent method to create reusable online functionality such as a blog, album, chat, and so on.
55. Are packages and modules the same thing?
- Yes
- No
Answer: B) NO
Explanation:
Packages are not straight online functions like a blog or an album. Instead, it is a collection of functions, such as email processing.
56. ____ allows client-side data storage but only supports a limited amount of data?
- Cookies
- Session
Answer: A) Cookies
Explanation:
Cookie allows client-side data storage but only supports a limited amount of data.
57. ____ stores data on the server and can handle a big quantity of data?
- Cookies
- Session
Answer: B) Session
Explanation:
Session stores data on the server and can handle a big quantity of data.
58. Cookies are created, assigned, and deleted using the ____ class?
- Session
- Create_cookies
- Cookies
- Cookie
Answer: D) Cookie
Explanation:
Cookies are created, assigned, and deleted using the Cookie class.
59. Which of the following cookie class methods is used to create a Cookie variable?
- Create()
- Set()
- Use()
- New()
Answer: B) Set()
Explanation:
To create a Cookie variable, use the set method.
60. A Cookie variable is read using which of the following cookie class methods?
- Read()
- Instance()
- Get()
Answer: C) Get()
Explanation:
A Cookie variable is read using the get method.
61. To keep the application’s state, FuelPHP offers the ____ class?
- Session
- State
- Public
- Assemble
Answer: A) Session
Explanation:
To keep the application’s state, FuelPHP offers the Session class.
62. Which of the following session class methods returns a default or a specific instance?
- This
- Instance
- Get
- Set
Answer: B) Instance
Explanation:
The instance method returns either a generic or a particular instance.
63. With which of the following session class methods you may create a new session?
- New()
- Start
- Creates()
Answer: C) Creates()
Explanation:
You may create a new session using the create method.
64. To terminate an existing session, which of the following session class methods is used?
- Del()
- Delete()
- End()
- Destroy()
Answer: D) Destroy()
Explanation:
To terminate an existing session, use the destroy method.
65. The ____ method allows you to obtain session key components?
- Unique
- Session
- Key
- All
Answer: C) Key
Explanation:
The key method allows you to obtain session key components.
66. Which of the following returns a new event object?
- New
- Forge
- Instance
Answer: B) Forge
Explanation:
Forge method returns a new event object.
67. Which of the following methods set the mail’s priority?
- Set()
- Set_mail()
- Set_priority()
- Priority()
Answer: D) Priority()
Explanation:
The priority method sets the mail’s priority.
68. Profiling is ____ by default?
- Enabled
- Disabled
Answer: B) Disabled
Explanation:
Profiling is disabled by default.
69. Which of the following profiler class methods simply add a log entry to the profiler?
- Console()
- Log()
- CLI()
Answer: A) Console()
Explanation:
The console method simply adds a log entry to the profiler.
70. HttpServerErrorException class handles ____?
- Server error
- Handle the unknown requests.
- Handle the access violations.
Answer: A) Server error
Explanation:
HttpServerErrorException class handles server errors.
71. HttpNoAccessException class ____?
- Server error
- Handle the unknown requests.
- Handle the access violations.
Answer: C) Handle the access violations.
Explanation:
HttpNoAccessException class Handles the access violations.
72. Do We need to install ____ before we can develop a unit test for the FuelPHP framework?
- Test
- PHP TEST
- PHPUnit
Answer: C) PHPUnit
Explanation:
We need to install PHPUnit before we can develop a unit test for the FuelPHP framework.
73. Which of the following commands runs all the tests in the directory?
- $ php oil run
- $ php oil test
- $ php test run
- $ php all test
Answer: B) $ php oil test
Explanation:
$ php oil test command runs all the tests in the directory.
74. Which of the following is the alternative to FuelPHP?
- Laravel
- Angular
- CakePHP
- All of the above
Answer: D) All of the above
Explanation:
Following are the alternatives of FuelPHP:
- Laravel
- Angular
- CakePHP
75. Which of the following companies are using FuelPHP?
- Amitum
- Spookies
- InventoryBase
- All of the above
Answer: D) All of the above
Explanation:
Following companies used FuelPHP: Amitum, Spookies, and InventoryBase.