The documentation of this project is still under active development. New features
are still being added to this project.
Documentation
Getting started
Installation
You can use Composer to create a new Tufu project. This is the equivalent of doing a git
clone/svn checkout followed by a "composer install".
Configuration
You should never store sensitive credentials in your code. To protect us we use Dotenv. (.env)
In our config file (config/config.php) we associate the sensitive credentials,
but may we need to extend it for our convenience.
Routing
Routes file
You should save our routes in the config/routes.php file.
Controller
Annotation Interceptors
You should use Annotations for Request and Response Interceptors.
The ResponseListener adds an Authorization: Bearer e0yYJSd... to the Response.
The RequestListener requires an X-Auth-Token: e0yYJSd... in the Request-Header.
You can add many interceptors as needed.
Template
Twig
Twig is a modern template engine for PHP.
More information can be found on the official Page.
Twig extensions
Here is a list of integrated filter and extensions.
truncate
Use the truncate filter to cut off a string after limit is reached
wordwrap
Use the wordwrap filter to split your text in lines with equal length.
route
Use the route extension to retrieve the right route-url.
asset
Use the asset extension to generate the right asset source path.
dump
Use the dump extension to dump in twig.
has_error
Use the has_error extension to determinate if field contains an error.
Resources
A resources is everything else expect php that is required for our application.