File structure

├── src/
│   ├── controller/
│   ├── model/
│   └── templates/
├── config/
│   ├──
│   └──
├── data/
│   ├── cache/
│   └── logs/
├── public/
│   ├── images/
│   └── ...
├── vendor/
├── index.php
├── .htaccess

The src directory contains the applications code, that means controller, templates, models, libraries and so on

The config directory contains all configuration files

The data directory contains files like logs or caches

The public directory contains files that are accessible by the browser like stylesheets, images or scripts

Getting started



//load autoloader
require_once 'vendor/autoload.php';

//init app

//run and emit app


The .htaccess file is used to redirect all requests to index.php except for files in the public directory.

#disable directory listing
Options -Indexes 

#switch on rewrite engine
RewriteEngine On

#allow robots.txt
RewriteRule robots.txt$ public/robots.txt [NC,L]

#if folder not "public", then rewrite to index.php
RewriteRule !^(public)/(.*)$ index.php [NC,L]

# All folder to index.php
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ index.php [NC,L,QSA]

#all existing files stream to browser
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^.*$ - [NC,L]

#other to index.php
RewriteRule ^(.*)$ index.php [NC,L,QSA]


In the standard configration we allow for instance some error reports and we add an autoloader to the namespace:

return array( 
    "namespace" => array(
        "src" => dirname(__dir__)."/src/"
    "config" => array(
        "display_errors" => true,