GithubHelp home page GithubHelp logo

mchiu / slim-mvc-skeleton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrmoneyc/slim-mvc-skeleton

0.0 0.0 0.0 11 KB

The simple skeleton project for Slim 3 that includes FluentPDO, Twig and Monolog.

License: MIT License

PHP 92.78% HTML 2.67% CSS 2.44% PLpgSQL 2.11%

slim-mvc-skeleton's Introduction

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

slim-mvc-skeleton's People

Contributors

mrmoneyc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.