Author: Awais Farooq

  • Form Programming

    FuelPHP provides three classes, Form Fieldset,, and Input,, to perform Form programming. In this chapter, let us learn Form programming in FuelPHP. Form As discussed earlier, Form class provides methods to create html form elements and the important methods are as follows − open() open() is used to create a new form. It provides the following two parameters − close()…

  • Models & Database

    Model plays an important role in FuelPHP web framework. It represents the business entities of the application. They are either provided by customers or fetched from backend database, manipulated according to the business rules and persisted back into the database. Let us learn about models and how they interact with back-end system in this chapter.…

  • Presenters

    FuelPHP provides an additional layer after the controller to generate views. Once the controller processes the input and is done with the business logic, it sends the control to the Presenter, which takes care of the extra logic such as fetching data from the database, setting view data, etc., and then, calls the View object. We…

  • Views

    View is the presentation layer of the MVC application. It separates the application logic from the presentation logic. When a controller needs to generate HTML, CSS, or any other content then, it forwards the task to the view engine. FuelPHP provides a simple and flexible class, View with all the necessary features of a view engine.…

  • Requests & Response

    HTTP request and HTTP response play an important role in any web application. We need to get the complete details of the http request to process it properly. Once processed, we need to send the processed data to the client through http response. FuelPHP provides excellent Request and Response class to read and write HTTP request and HTTP response…

  • Routing

    Routing maps request an URI to a specific controller’s method. In this chapter, we will discuss the concept of routing in FuelPHP in detail. Configuration Routes configuration file is located at fuel/app/config/routes.php. The default routes.php file is defined as follows − Here, _root_ is the predefined default route, which will be matched when the application is requested with root path, / e.g. http://localhost:8080/.…

  • Controllers

    Controllers are responsible for handling each request that comes into FuelPHP application. According to FuelPHP, controllers are located at fuel/app/classes/controller/. Let’s first create an Employee Controller. employee.php Controller Methods Controllers process a web request by using one of its action_ methods. We can create as many action_ methods depending on the requirement of the application. The default action_ method is action_index. action_index method can be…

  • Configuration

    In this chapter, we will understand how to configure a FuelPHP application. By default, configuration files are stored inside the fuel/app/config folder. The application’s main configuration is fuel/app/config/config.php. The configuration is specified using PHP’s associated array. Overview By default, all default configuration files are defined in fuel/core/config folder. To override a default configuration, add the corresponding key in the /fuel/app/config/config.php file and…

  • Simple Web Application

    In this chapter, we will see how to create a simple application in FuelPHP framework. As discussed earlier, you know how to create a new project in Fuel. We can take an example of Employee details. Let’s start by creating a project named Employee using the following command. After executing the command, an employee project is created…

  • Architecture Overview

    FuelPHP is based on battle tested Model-View-Controller architecture along with HMVC (Hierarchical MVC) support. While MVC provides flexible and layered application development, HMVC goes one step further to enable widgetization of the web application. The strength of FuelPHP is that it does not enforce specific ways to develop an application. It just provides a simple and easy-to-use standard structure.…