akbsit / slim-skeleton
The framework of a PHP application based on the Slim Framework.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^7.4
- illuminate/validation: ^5.7
- slim/csrf: ^0.8.3
- slim/slim: ^3.11
- slim/twig-view: ^2.4
README
Framework PHP application based on Slim Framework.
Includes packages:
To install the application, you need to deploy it in your working folder:
composer create-project akbsit/slim-skeleton ./ "1.*"
Create an environment settings file based on the example .env.example
, for local environment .env.local
, for production .env.production
.
The local environment is defined by subdomains: .loc
и .local
.
Adding settings
Application uses two types of settings:
- Required (without their definition in
.env.local
and.env.production
the application will not start); - Optional.
All settings names are converted to upper case.
Adding required settings
The required set of settings can be supplemented in the environment definition file src/Env.php
- the $arRequiredParams
parameter (it is important not to delete the default settings as they are used in the application). After that, all added settings will need to be defined in the configuration file configs/app.php
by analogy.
It is not recommended to use this method!
Adding optional settings
To add your own set, you will need to create a file with an arbitrary name in the configs
folder and with the contents:
custom_config.php
return [ 'CONFIG_NAME_1' => 'CONFIG_VALUE_1', 'CONFIG_NAME_2' => 'CONFIG_VALUE_2', 'CONFIG_NAME_3' => 'CONFIG_VALUE_3', 'CONFIG_NAME_4' => 'CONFIG_VALUE_4' ];
After which the settings will be available in the application. The file name is a key in the config
array. Example of use in a controller:
$this->config->CUSTOM_CONFIG['CONFIG_NAME_1']