This is a simple skeleton project for Slim 3 that includes Doctrine, Twig, Flash messages and Monolog.
Base on https://github.com/akrabat/slim3-skeleton
-
Create your project:
`$ composer create-project -n -s dev vhchung/slim3-skeleton-mvc your-app`
-
Execute
your-app\sql\blog.sql
to create sample database (MySQL) -
Change database connection settings at
entities_generator.php
andapp/settings.php
-
Generate models (Doctrine entities):
$ cd your-app
$ php entities_generator.php
Add namespace for each model: namespace App\Model;
Notice: Delete all models before re-generate to update models.
$ cd your-app
$ php -S 0.0.0.0:8888 -t public/
- Browse to http://localhost:8888
Set logs
and cache
folder permission to writable when deploy to production environment
app
: Application codeapp/src
: All class files within theApp
namespaceapp/templates
: Twig template filescache/twig
: Twig's Autocreated cache fileslog
: Log filespublic
: Webserver rootvendor
: Composer dependenciessql
: sql dump file for sample database
public/index.php
: Entry point to applicationapp/settings.php
: Configurationapp/dependencies.php
: Services for Pimpleapp/middleware.php
: Application middlewareapp/routes.php
: All application routes are hereapp/src/controllers/HomeController.php
: Controller class for the home pageapp/src/models/Post.php
: Entity class for post tableapp/templates/home.twig
: Twig template file for the home page