Top Interview Questions & Answers | Learn Now

FuelPHP Interview Questions and Answers | Basic and Advanced Level

Written by Mohammed | May 18, 2018 11:34:20 AM

Q1. What is FuelPHP?

Ans: 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?

Ans: PHP 5.4+

Q3. What are the features of FuelPHPFramework?

Ans: FuelPHPFramework features are:

  • URL routing system
  • Restful implementation
  • HMVC implementation
  • Form Data validation
  • ORM (Object Relational Mapper)
  • Vulnerability protections like XSS, CSRF, SQL Protection and encode output.
  • Caching System

Q4. What are the minimum requirements for installing FuelPHPFramework?

Ans: 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?

Ans:

  • Modularization
  • Organization
  • Reusability
  • Extensibility

Q6. List Reserved Routes In Fuelphp.

Ans: 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?

Ans: 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?

Ans: 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?

Ans: 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?

Ans: 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?

Ans: 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?

Ans: try { $redis = \Redis::instance(); } catch(\RedisException $e) { //here error will come }

Q13. What Are Inbuilt Security Features Comes With Fuelphp?

Ans: 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?

Ans: 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?

Ans: Yes, FuelPHP supports Multilingual.

Related Interview Questions...