FuelPHP Interview Questions and Answers

Q1. What is FuelPHP?
FuelPHP is PHP Framework written in PHP based on the HMVC pattern.FuelPHP is a simple, flexible, community driven PHP 5.3 web framework based on the best ideas of other frameworks with a fresh start.

Q2. What is minimum PHP Version required for FulePHP?
PHP 5.4+

Q3. What are the features of FuelPHPFramework?
FuelPHPFramework features are:

  1. URL routing system
  2. Restful implementation
  3. HMVC implementation
  4. Form Data validation
  5. ORM (Object Relational Mapper)
  6. Vulnerability protections like XSS, CSRF, SQL Protection and encode output.
  7. Caching System

Q4. What are the minimum requirements for installing FuelPHPFramework?
There are the following minimum requirements for installing FuelPHPFuelPHP Framework:

  • PHP Version >= 5.3.3
  • Mbstringphp extension installed and enabled
  • Mcryptphp extension installed and enabled
  • Fileinfophp extension installed and enabled
  • PHPUnit version 3.7 or greater is required if we want to run unit tests.

Q5. What Are Benefits Of Hmvc?

  1. Modularization
  2. Organization
  3. Reusability
  4. Extensibility

Q6. List Reserved Routes In Fuelphp.
In Fuel, there are 4 reserved routes. They are _root_, _403_, _404_ and _500_.

  • _root_ – The default route when no URI is specified.
  • _403_ – The route used when the application throws an HttpNoAccessException that isn’t caught.
  • _404_ – The route used when the application throws an HttpNotFoundException that isn’t caught.
  • _500_ – The route used when the application throws an HttpServerErrorException that isn’t caught.

Q7. How can we quick installFuelPHP Framework?
We can quick install FuelPHP Framework by using some command:
Quick installation using Oil from the web.
$ curl https://get.fuelphp.com/oil | sh

Now that oil is installed, create a blog project in a directory called Sites.
1. $ cd Sites/
2. $ oil create blog

Q8. What is the controller in FuelPhp framework?
Controller is a class that contains action methods. It is used to manage HTTP client request and respond back.
All controllers are stored in the fuel/app/classes/controller/ directory.
Example:

classController_Employee extends Controller {
public function action_home() {
echo “FuelPHP-Employee application!”;
}

public function action_index() {
echo “This is the index method of employee controller”;
}
}

There are two methods in the controller.

  1. before() action method
  2. after() action method.

Q9. What is the use of Oil Package in FuelPHPFramework?
In FuelPHP, Oil package is used for installation, development and testing of application.

Q10. What is Presenter and how to create Presenter in FuelPHP Framework?
A Presenter is a class that contains the logic. It is needed to generate our view. A Presenter should not do any data manipulation but it can contain database calls or any other retrieval.
To create empty Presenters:
classPresenter_Index extends Presenter
{
— Body —
}

Q11. How can we get query in FuelPHP Framework?
In FuelPHP, we can get query by using following steps:
$userQueryToExecute = Model_Article::query()
->select(‘users’)
->where(‘blocked’‘=’, 1);
echo
$userQueryToExecute ->get_query();

Q12. How to check that Redis server is running?
try { $redis = \Redis::instance(); } catch(\RedisException $e) { //here error will come }

Q13. What Are Inbuilt Security Features Comes With Fuelphp?
Fuel takes security very seriously, and as a result, has implemented the following measures to ensure the safety of your web applications:

  • Output encoding
  • CSRF protection
  • XSS filtering
  • Input filtering
  • SQL injection

Q14. What are the Session methods in FuelPHP?
In FuelPHP Session methods are given below table:

Session Methods Description
set() It is used to assign a session variable.
get() It is used to assign a session variable.
delete() It is used to retrieve the stored variable from the sessions.
create() It is used to create a new session.
destroy() It is used to destroy an existing session.

Q15. Is FuelPHP support Multilingual?
Yes, FuelPHP supports Multilingual.

Summary
Review Date
Reviewed Item
Good post and neatly presented
Author Rating
51star1star1star1star1star