BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Fuel PHP: An MVC Framework

Fuel PHP: An MVC Framework

This item in japanese

The Model-View-Controller pattern is pretty much dominating professional, customer facing website design these days. While single-file scripts are still suitable for personal sites and form builder technologies such as ASP.NET Web Forms offer fast development times, MVC seems to strike the right balance who need to work in large teams and yet still have fine grained control over the generated HTML. The Fuel framework for PHP intends to capitalize on the work done by earlier MVC frameworks such as CodeIgniter, Zend Framework, Symphony and Ruby on Rails.

Like most MVC frameworks, the file structure has meaning. There are specific folders for assets, views, controllers, and models. In addition there are places to put general application code and framework packages. While routes can be configured, by default a URL is mapped to the name of the controller class and action method.

A common objection to MVC style frameworks is the additional amount of code necessary to do anything. With single-file scripts, one handles everything from request processing to HTML generation in a simple, linear fashion. By contract, MVC requires at least a controller and view, and in most cases a model is needed to transmit data from one to the other. Scaffolding, a form of code generation, is thus quite popular. In Fuel PHP an application called “oil” is used for this purpose.

The Philip Sturgeon’s walk-through on Nettuts+ also covers form generation and data validation. Again, these are standard techniques that are quite familiar to MVC developers on other platforms. Fuel has a basic database abstraction layer out of the box and an optional ORM package for those who prefer that form of data access. The ORM is based primarily on ActiveRecord, but was also influenced by other ORMs.

Fuel is released under the MIT license and is currently in its first release candidate with at least one more planned.

Rate this Article

Adoption
Style

BT