# Skeleton

Leaf Skeleton is a lightweight and minimal MVC boilerplate for leaf PHP framework that provides a more scalable and powerful setup for creating web apps and APIs quickly and efficiently. Skeleton is simply a boilerplate and so avoids all the rules involved in building with full-featured frameworks like leaf API and leaf MVC.

Skeleton 3.0 comes in with a bunch of fresh functionality, and also features added in v3 (opens new window) of the core Leaf package. You can view all these changes here.

# Why Skeleton?

# Shallow learning curve

Whether you are new to PHP or have prior experience with the language, Skeleton helps you fit right in. All you need to get started with Leaf MVC is basic PHP knowledge and a little familiarity with MVC concepts. You can learn Leaf as you build.

# Lightweight

Skeleton is not a framework, it is simply leaf with a few pre-installed modules and a bunch of folders. This means that it is fast and almost as light as simply building with leaf core.

# Powerful

Skeleton packs a ton of powerful tools which speed up your development process by folds. You have simple tools and modules like authentication (opens new window), MVC tools with MVC core (opens new window) and a ton of other modules (opens new window).

# Installation

You can quickly create a Skeleton project with Leaf CLI (opens new window).

leaf create <project-name> --skeleton --v3
1

Or with composer:

composer create-project leafs/skeleton <project-name>
1

# Directory Structure

This will create a new Skeleton project named <project-name>. Inside the new directory, you should have a structure like this.

Note

The directory structure has had a refresh. We normalized the folder cases to lowercase. Note that this only applies to the default Skeleton folders. Custom folders will have to follow the class structure as done in earlier versions.

C:.
├── config
│   ├── app.php
│   ├── auth.php
│   ├── cors.php
│   ├── database.php
│   ├── paths.php
│   └── view.php
├── controllers
│   ├── Controller.php
│   └── TestsController.php
├── models
│   ├── Model.php
│   └── Test.php
├── pages
│   ├── body.view.php
│   ├── components
│   ├── index.html
│   ├── styles.css
│   └── test.view.php
├── routes
│   ├── _app.php
│   └── index.php
├── storage
│   ├── app
│   ├── framework
│   └── logs
├── vendor
└── index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  • config: This holds all your configuration files.
  • controllers: This directory holds all your controllers
  • models: This holds all your models
  • pages: This holds all your views
  • routes: This holds all your routes
  • storage: Storage for your files, images, text, databases...
  • vendor: This holds all your dependencies and installed files.

Directory Structure

Skeleton is 100% customizable. You can rearrange the directories to match your preference. Simply reconfigure the directories in config/paths.php

In the project root, you can open up your console tool and type in

php leaf serve
1

This will start the php web server and load your project at http://localhost:5500 by default.