300+ TOP FuelPHP Interview Questions and Answers

FuelPHP Interview Questions for freshers experienced :-

1. What is FuelPHP Framework?

  • FuelPHP Framework is an open source web application and written in PHP scripting language.
  • It is based on the HMVC (Hierarchical Model View Controller) design pattern.
  • It was released on January 1, 2014 by GitHub repository named FuelPHP.

2. What is the current Stable version of FuelPHPFramework?
FuelPHP current Stable version is1.8and released on 9 April 2016.

3. What are the supported template engines inFuelPHPFramework?
There are following template engines in FuelPHPFramework:

  • Mustache
  • Markdown
  • Smarty
  • Twig
  • Haml
  • Jade
  • Dwoo
  • Phptal

4. What are the features of FuelPHPFramework?
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

5. 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.

6. What are the benefits of HMVC in FuelPHPFramework?
In FuelPHPFramework, HMVC benefitsare:

  • Modularization
  • Organization
  • Reusability
  • Extendibility

7. What are the inbuilt security features of FuelPHP Framework?
FuelPHPFrameworkprovides inbuilt security features that are:

  1. Output encoding
  2. CSRF protection
  3. XSS filtering
  4. Input filtering
  5. SQL injection

8. 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.

$ cd Sites/

$ oil create blog

9. 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.

before() action method

after() action method.

10. What are the types of Reserved Routes in FuelPHP Framework?
In FuelPHP, there are various types of Reserved Routes:

  • root_: The default route when no URI is specified.
  • _403_: It throws an HttpNoAccessException that isn’t caught.
  • _404_: It throws an HttpNotFoundException that isn’t caught.
  • _500_: It throws an HttpServerErrorException that isn’t caught.
FuelPHP Interview Questions
FuelPHP Interview Questions

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

12. 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 —

}

13. 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();

14. How can we check Redis server is running or not?
We can check Redis server is running or not by using following source code.

Try

{

$redis = \Redis::instance();

}

catch(\RedisException $e)

{

//here error will come

}

15. What are the Event methods in FuelPHP Framework?
InFuelPHP Framework, events methods are used to application events. Some methods are given below.

register(): It allows files to register an object that will be run when the trigger method is called.

Example

$my_event_code = function() {

echo ‘my event’;

}

Event::register(‘my_event’, $my_event_code);

unregister(): It allows the files to unregister an object that would be run when the trigger method is called.

Example

Event::unregister(‘my_event’, $my_event_code);

trigger(): It is used to trigger or activate callbacks that are associated through the register method.

Example

has_events(): It is used to check if a particular registered event has triggers.

Example

Event::has_events(‘my_event’);

16. What is Oil?
Oil is a FuelPHP tool that used Command line installation method.

17. Who is the developer of FuelPHP?
Harro Verton, Jelmer Schreuder, and Dan Horrigan are the developer of Fuel PHP.

18. What is Scaffolding in FuelPHP?
In FuelPHP, Scaffolding is a meta-programming method for building database operations.

19. What are the web servers of FuelPHP?
There are following web servers of FuelPHP:

  • WAMP (Windows)
  • Microsoft IIS (Windows)
  • LAMP (Linux)
  • MAMP (Macintosh)
  • XAMP (Multi-platform)
  • Nginx (Multi-platform)
  • PHP in-built development web server (Multi-platform)

20. What are controllers?
Controllers are responsible for handing each request. It is located at fuel/app/classes/controller/ files.

21. What is the two important method of controller
Two important method of controller is: before() and after()

22. How to create a validation objects?
Forge() method is used to create a validation objects.

Example:

$val = Validation::forge();

23. What are the upload classes in FuelPHP?
There are following upload class in FuelPHP.

  • Upload class Description
  • Max_size It is used to set maximum size of the file to be uploaded.
  • ext_whitelist It is used to allow file extensions.
  • ext_blacklist It is used to disallow file extensions.
  • type_blacklist It is used to set disallowed file types.
  • mime_blacklist It is used to set disallowed mime file types.

24. How to handle an Ajax request properly on the server?
The following code is used to handle an Ajax request properly on the server.

if (Input::is_ajax()) {

// Ajax request

} else {

// Normal request

}

25. What are the types of controllers in FuelPHP?
In FuelPHP, There are four types of controller:

  1. Base controller
  2. Template controller
  3. Rest controller
  4. Hybrid controller

26. What is Query Builder API?
Query builder classes provide options to build SQL queries dynamically.

Example:

$query = DB::select(‘name’) // select `name`

$query = DB::select(array(‘first_name’, ‘name’)) // select ‘first_name’ as ‘name’

27. Does FuelPHP support multiple themes?
Yes, FuelPHP support multiple themes.

28. 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.

29. What are the predefine events in FuelPHP?
In FuelPHP, there are various predefine events:

  • app_created
  • request_created
  • request_started
  • controller_started
  • controller_finished
  • response_created
  • request_finished
  • shutdown

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

FuelPHP Questions and Answers Pdf Download

Leave a Reply

Your email address will not be published. Required fields are marked *