Flight Skeleton
This skeleton provides you a quick start for the development of an application with the Flight PHP microframework., (*1)
It also contains some templates based on HTML5 Boilerplate., (*2)
Downloading the skeleton
First, check that you have installed and configured a web server (such as Apache) with PHP 5.3.3 or higher. Then use composer to create your project:, (*3)
$ composer create-project damel/flight-skeleton path/to/install
, (*4)
You'll find this structure:, (*5)
path/to/install
โโโ app
โย ย โโโ config
โย ย โย ย โโโ config.php
โย ย โย ย โโโ routes.php
โย ย โโโ logs
โย ย โโโ resources
โย ย โโโ templates
โย ย โโโ 404.php
โย ย โโโ index.php
โย ย โโโ layout.php
โโโ cli
โโโ public
โย ย โโโ css
โย ย โย ย โโโ main.css
โย ย โย ย โโโ normalize.css
โย ย โโโ img
โย ย โโโ js
โย ย โย ย โโโ modernizr-2.6.2.min.js
โย ย โย ย โโโ plugins.js
โย ย โโโ .htaccess
โย ย โโโ apple-touch-icon*.png
โย ย โโโ crossdomain.xml
โย ย โโโ favicon.ico
โย ย โโโ humans.txt
โย ย โโโ index.php
โย ย โโโ robots.txt
โโโ src
โย ย โโโ Acme
โย ย โโโ Demo
โย ย โโโ Controller
โย ย โโโ Demo.php
โโโ vendor
โย ย โโโ composer
โย ย โโโ mikecao
โย ย โโโ autoload.php
โโโ composer.json
โโโ composer.lock
โโโ LICENSE
โโโ README.md
Creating the application
If you want to define global constants or other settings, you can use the config.php
in app/config/
., (*6)
Routing
To define your routes, use the file app/config/routes
:, (*7)
<?php
//Routes of the application.
\Flight::route('/', array('\Acme\Demo\Controller\Demo', 'index'));
Controllers
Place your code in the src
folder. All classes from here are autoloaded by their namespace. For an example, have a look in the demo code in src/Acme/demo/Controller/Demo.php
. As you can see, the controller uses the namespace Acme\Demo\Controller
., (*8)
Templates
Templates are loaded by default from app/resouces/templates/
. You can change this by editing the path in app/config/config.php
., (*9)
License
The skeleton is licensed under the MIT license., (*10)