Web skeleton ready to work with Slim and SCSS.
- Changed project structure to split php, precompiled resources and public documents.
- Now supports complete Handlebars templates rendering with Gulp task.
- Includes Eloquent ORM for Database Management ready to use.
- Includes CSRF protection with
slim/csrfpackage and middleware - Instead of using php-view, now I'm using twig view, a more powerful template engine.
- Added new gulp task to minify and copy useful code into new dist folder, ready to upload to your production server.
Template is ready to execute
composer installand
npm installand it will include all vendor and npm packages.
If you want to execute gulp from your console you need to install it first:
npm install --global gulp-cliYou can copy the /apache.conf file to your apache2 web server sites-available folder. It includes all necessary statements to make it work.
Remember to grant access to apache user to write files into /cache and /public_html/uploads folders.
Ubuntu users can type this (as sudo):
chown -R www-data:www-data cache public_html/uploads
I've configured this skeleton to split backend (private) part from frontend (public) part and from the precompiled things.
It's important that all controllers are in the
/App/Controllersfolder or subfolders because the bootloader loads and injects them from that route.
Once you have downloaded gulp just type gulp on a shell window in root folder and it executes the default task that compiles SCSS into CSS, compiles Handlebars templates and enables the LiveReload to watch changes.
- SCSS takes the
/resources/scss/style.scssfile and generates the/public_html/css/style.cssthat you should include into your html. - Handlebars takes the
/resources/templates/*.handlebarshandlebars files and compiles them into the/public_html/views/templates.js. - LiveReload watches for any change in the project root directory and compile scss and handlebars files.
I've also included a production task that executes the uglify and minify tasks and copies the required files into a new folder called /dist that you can safely upload to your server.