Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
/ Slim-Starter Public archive

Preconfigured Slim app including PHP-DI, Twig and Doctrine DBAL.

License

Notifications You must be signed in to change notification settings

AymDev/Slim-Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slim Starter

Preconfigured Slim app including PHP-DI, Twig and Doctrine DBAL.

Minimum requirement: PHP 7.2

Additional dependencies:

  • Whoops for error handling

Installation

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

Usage

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.

Configuration

Some services are already configured in the config/bootstrap.php. To configure your Doctrine DBAL database connection, add your params in config/doctrine.php.

Controllers

A AbstractController class is present with methods for rendering Twig templates and to redirect to another route.

Templating

A link() function has been added to Twig to create links to routes in templates.