Preconfigured Slim app including PHP-DI, Twig and Doctrine DBAL.
Minimum requirement: PHP 7.2
Additional dependencies:
- Whoops for error handling
Clone the repository, move into the created directory and install Composer dependencies:
git clone https://github.com/AymDev/Slim-Starter.git slim-app
cd slim-app
composer install
The web server implementation is left to the developer. For a quick start, use the PHP built-in server:
php -S localhost:8000 -t public
You will find the default page on http://localhost:8000
.
Some services are already configured in the config/bootstrap.php
.
To configure your Doctrine DBAL database connection, add your params in config/doctrine.php
.
A AbstractController
class is present with methods for rendering Twig templates and to redirect to another route.
A link()
function has been added to Twig to create links to routes in templates.