Book Image

Learning FuelPHP for Effective PHP Development

By : Ross Tweedie
Book Image

Learning FuelPHP for Effective PHP Development

By: Ross Tweedie

Overview of this book

<p>PHP frameworks have been around for a number of years. FuelPHP was one of the first frameworks built for PHP 5.3. It makes use of more advanced features of the language to allow you to focus on delivering features and code for your projects. FuelPHP allows you to quickly build prototypes using scaffolding and command-line tools, thus allowing you to concentrate on the fun part of trialling ideas and concepts.</p> <p>This practical guide will show you how to use FuelPHP to quickly create projects more quickly and effectively. You will learn everything you need to know when creating projects with FuelPHP, including how to adapt the project as ideas change and develop.</p> <p>This guide is packed with several tutorials that will help you to build a powerful and engaging application, and in the process you will learn more about FuelPHP. This book explores how to install and build a FuelPHP project in a step- by- step approach.</p> <p>Starting with an exploration of the features of FuelPHP, this book then delves into the creation of a simple application. You will then move on to scaffolding your application using the powerful FuelPHP Oil command-line tool. Next, you will be introduced to packages and modules, and also cover routing, which allows for cleaner URL structures.</p> <p>The book concludes with an introduction to the PHP community.</p>
Table of Contents (14 chapters)

An introduction to building your own package


As you have seen so far, packages are very useful, besides they can also be simple to create. We will run through some of the basics in this section while creating a text manipulation package.

Setting up a repository

The first thing to do is set up a repository. Like in the previous chapter, we will use GitHub.

We will be creating a package called Journal String; this will have a repository name of journal-string. Ordinarily, it is recommend to use something like Fuel String, but since this is a simple example, it's not necessary to include Fuel within the title of the package.

We will be using the new repository as a submodule within the journal project, so make sure you make a note of the repository address, which will be something like [email protected]:digitales/journal-string.git.

Working the package as a submodule

We need to add this new submodule into our project, so it's time to load a console/terminal window. In the terminal, navigate to the top...