https://github.com/mrmoneyc/slim-mvc-skeleton
The simple skeleton project for Slim 3 that includes FluentPDO, Twig and Monolog.
https://github.com/mrmoneyc/slim-mvc-skeleton
php skeleton slim-framework
Last synced: 5 months ago
JSON representation
The simple skeleton project for Slim 3 that includes FluentPDO, Twig and Monolog.
- Host: GitHub
- URL: https://github.com/mrmoneyc/slim-mvc-skeleton
- Owner: mrmoneyc
- License: mit
- Created: 2016-04-28T06:46:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-26T10:13:13.000Z (about 10 years ago)
- Last Synced: 2024-09-25T20:41:01.047Z (over 1 year ago)
- Topics: php, skeleton, slim-framework
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slim 3 MVC Skeleton
This is a simple skeleton project for Slim 3 that includes FluentPDO, Twig and Monolog.
Base on https://github.com/vhchung/slim3-skeleton-mvc
## Prepare
1. Create your project:
`$ composer create-project -n -s dev mrmoneyc/slim-mvc-skeleton YOUR_APP_NAME`
2. Create database: `$ cat sql/db.sql | sqlite3 storage/db/db.sqlite`
### Run it:
1. `$ cd YOUR_APP_NAME`
2. `$ php -S 0.0.0.0:8888 -t public/`
3. Browse to http://localhost:8888
### Run coding style check
1. Install [PHP_CodeSniffer] (https://github.com/squizlabs/PHP_CodeSniffer)
2. `$ cd YOUR_APP_NAME`
3. `$ phpcs`
### Run test
1. Install [PHPUnit] (https://phpunit.de/)
2. `$ cd YOUR_APP_NAME`
3. `$ phpunit`
### Notice
Set `storage/` folder permission to writable when deploy to production environment
## Key directories
* `app`: Application code
* `app/controllers`: Controller files
* `app/models`: Model files
* `app/templates`: Template files
* `storage/log`: Log files
* `storage/db`: SQLite DB files
* `public`: Webserver root
* `vendor`: Composer dependencies
* `sql`: sql dump file for sample database
## Key files
* `public/index.php`: Entry point to application
* `app/settings.php`: Configuration
* `app/dependencies.php`: Services for Pimple
* `app/middleware.php`: Application middleware
* `app/routes.php`: All application routes are here
* `app/controllers/IndexController.php`: Controller class for the home page
* `app/models/ConfigurationModel.php`: Model class for configurations table
* `app/templates/index.twig`: Template file for the home page