FuelPHP Interview Questions and Answers

Questions

16

Last updated

Mar 21, 2022

Most Frequently Asked FuelPHP Interview Questions

Here in this article, we will be listing frequently asked FuelPHP Interview Questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.

Q1. What is FuelPHP and why it is used?
Answer

It is a web application framework and is an open source platform which works to execute HMVC pattern. The long list of the features of the technology is the answer to the above question.

The main traits which make FuelPHP framework user-friendly are-

  • Easy configuration
  • Enhanced usability
  • Provides authorized and authenticated framework
  • Increased portability
  • Ease of use in the server
  • Prevents SQL inject
Q2. Name the current Stable version of FuelPHP
Answer

In the year 2018, the updated version of FuelPHP, 1.8.1 was released. It contains improved functionalities, fixes the bugs, and several usual improvements.

Q3. List some advantages and disadvantages of FuelPHP?
Answer
  • Sparse documentation along with incomplete sections.
  • Somewhat complex structure to understand especially by PHP or Codeigniter developers at the beginners to intermediate level.
  • Small community and less number of applications built
  • Hard to learn the conventions of the naming space
Q4. What are the template engines supported by FuelPHP Framework?
Answer
  • Mustache
  • Jade
  • Dwoo
  • Phptal
  • Markdown
  • Smarty
  • Twig
  • Haml

Interesting, right? Read on to know more FuelPHP Interview Questions.

Q5. What is HMVC in fuelPHP?
Answer

It is a Hierarchical Model-View-Controller framework used in FuelPHP providing the permission of requesting the internal controllers from the applications. It is a direct extension to the MVC pattern which helps in managing all the pre-defined scalability issues.

Q6. Lists the minimum requirements for installing the FuelPHP Framework?
Answer
  • The minimum PHP version is 5.3.3
  • installed and enabled Mbstringphp extension
  • Fileinfophp extension installed and enabled
  • PHPUnit version >=3.7 as per the requirement of running the unit tests.
  • Installed and enabled Mcryptphp extension.
Q7. What are the default security features provided by FuelPHP frameworks?
Answer
  • Encoding of the output
  • Input filtering
  • XSS filtering
  • Filtering of URLs
  • Prevention of SQL injection
  • CSRF token protection
Q8. How to install the FuelPHP Framework?
Answer
Q9. Explain the Reserved Routes in FuelPHP Framework?
Answer
There are four reserved routes-
  • _403_-This route is followed at the time of uncaught HttpNoAccessException.
  • _root_-It is the default route to be followed due to the unspecified URI.
  • _404_-At the time of HttpNotFoundException, this route is followed.
  • _500_- Uncaught HttpServerErrorException leads to following this route.
Q10. What is Presenter and how we can create Presenter in FuelPHP Framework?
Answer

A class containing logic is called as a presenter. It is useful for generating our view. A presenter can consist of database calls or the related retrievals but not perform any data manipulations.

Creating Presenter is FuelPHP-

classPresenter_Index extends Presenter
{
     // Body
}

Q11. How to write the select query in FuelPHP Framework?
Answer

DB::select('name')->from('admin')->execute();

Q12. What is Scaffolding in FuelPHP?
Answer

The term Scaffolding is a meta-data programming method needed for building database operations. The scaffolding of the concept FuelPHP which makes the work easy and helpful in allowing to get a basic CRUD application that too following simple and easy steps. It is one of the common FuelPHP Interview Questions.

Q13. How to create a validation object in FuelPHP?
Answer

1. Create an object.

2. Instantiate it, $val = Validation::forge('my_validation');

3. Start adding fields to it, $val = Validation::forge('my_validation');

4. Add username to it, $val->add('username', 'Your username')->add_rule;

5. Add column for password, $val->add('password', 'Your password')

     ->add_rule('required')

     ->add_rule('min_length', 3)

     ->add_rule('max_length', 10);

(The digits are as per the requirements)

6. Add the next field, the gender field- $val->add('gender', 'Your gender')-

     >add_rule('required')

    ->add_rule('match_collection', array('M', 'F'));

If any other validations are to be given, then give them using add_rule() method.

   Or

Forge ( ) method is used for creating a validating objects, such as $val= Validation:: forge( );

Q14. How to check an Ajax request on the server?
Answer

Checking an Ajax request on the server is a task which can be done with the help of input class method. If there has been an Ajax request on the server, then the function, Input::is_ajax will return true, and in the otherwise case, it will return false.

if (Input::is_ajax()) {
    // Ajax request
} else {
    // Normal request
}

Q15. Explain the types of controllers in FuelPHP?
Answer
  • Base controller
  • Rest controller
  • Hybrid controller
  • Template controller
Q16. Explain the Session methods in FuelPHP?
Answer
  • Create ()- Used for creating a new session.
  • Set ()- Used for assigning a session variable.
  • Destroy ()- Destroying the existing session is the main task of this method.
  • Get ()- it gets the sessions variable.
  • Delete ()- It deletes the stored variable which has been retrieved from the sessions.