Dotkernel Light follows the PSR-4 standards.
It is a good practice to standardize the file structure of projects.
When using Dotkernel Light, the following structure is installed by default:
.github
- containes workflow files.laminas-ci
- contains laminas-ci workflow filesbin
folderThis folder contents are
clear-config-cache.php
- Removes the config cache file data/cache/config-cache.php
; available only when development mode is enabledconfig
folderThis folder contains all application-related config files:
config.php
- Registers ConfigProviders for installing packagescontainer.php
- Main service container that provides access to all registered servicesdevelopment.config.php.dist
- Activates debug mode; gets symlinked as development.config.php
when enabling development modepipeline.php
- Contains a list of middlewares, in the order of their executiontwig-cs-fixer.php
- Configuration file for Twig code style checker/fixerconfig/autoload
folderThis folder contains all service-related local and global config files:
app.global.php
- Configures basic app variablesdependencies.global.php
- Config file to set global dependencies that should be accessible by all modulesdevelopment.local.php.dist
- Gets symlinked as development.local.php
when enabling development mode; activates error handlerserror-handling.global.php
- Configures and activates error logslocal.php.dist
- Local config file where you can overwrite application name and URLmezzio.global.php
- Mezzio core config filetemplates.global.php
- dotkernel/dot-twigrenderer config filedata/cache
folderThis folder is a storage for service caches.
log
folderThis folder stores daily log files.
When you access the application from the browser, (if not already created) a new log file gets created in the format specified in the config/autoload/error-handling.global.php
config file under the stream
array key.
public
folderThis folder contains all publicly available assets and serves as the entry point of the application:
css
and js
- Contains the css and js file(s) generated by the webpack (npm) from the assets folderfonts
and images
- Contain the font and image file(s) copied by the webpack (npm) from the assets folderuploads
- a folder that normally contains admin avatar images.htaccess
- server configuration file used by Apache web server; it enables the URL rewrite functionalityindex.php
- the application's main entry pointrobots.txt.dist
- a sample robots.txt file that allows/denies bot access to certain areas of your application; activate it by duplicating the file as robots.txt
and comment out the lines that don't match your environmentsrc
directoryThis folder contains a separate folder for each Module.
These are the modules included by default:
App
- Core functionality, from authentication, to rendering, to error reportingPage
- Contains functionality for displaying a pageEach Module folder, in turn, should contain the following folders, unless they are empty:
src/Controller
- Action classessrc/Service
- Service classesThe above example is just some of the folders a project may include, but they should give you an idea about the recommended structure.
Other classes the src
folder may include are InputFilter
, EventListener
, Helper
, Command
, Factory
etc.
The src
folder in each Module folder normally also contains these files:
ConfigProvider.php
- Configuration data for the moduleRoutesDelegator.php
- Module specific route registrationstemplates
directory for modulesThis directory contains the template files.
twig
is used as Templating Engine. All template files have the extension.html.twig
.