Clone or download this repo.
If you're using Composer to manage dependencies, install them:
composer install
If you're having trouble getting setup, read through the list below.
- Server Error 500 This is most likely missing Composer dependencies. Try running
composer install
. - Required file: [filename] either does not exist or is not readable. A core include is missing or unreadable. Check file permissions and make sure no core files have been moved or deleted.
- Default Controller: [filename] is missing or unreadable. There must be at least an
index.php
file present in the_controller
directory. Even if it is empty, the Controller class will fallback to this if no path-specific controller is found.
Boilerplate was designed to be a quick-start base for PHP based websites and simple apps. The following are just guidelines but if you're going to share your creations I recommend you try to follow them.
The _includes
directory is home to the core includes as well as composer dependencies. For using third party packages, I recommend using Composer as it can be a real time saver with updates etc. When adding your own code, create a seperate directory within the _includes
directory, something like project
or app
works well. This just ensures that any future updates to Boilerplate won't break your code!
Theming is supported in Boilerplate and you can enable Twig support by changing a value in .config.yml
. The default _templates
directory is where Boilerplate will look for theme files by default. You can change this using the $_theme->use_theme()
method. This accepts a directory location and will then look in that directory for template files. This can be particularly useful for plugins which may need to use a custom theme for specific paths.