https://github.com/akbsit/slim-skeleton
The framework of a PHP application based on the Slim Framework.
https://github.com/akbsit/slim-skeleton
framework php slim slim-framework
Last synced: about 1 month ago
JSON representation
The framework of a PHP application based on the Slim Framework.
- Host: GitHub
- URL: https://github.com/akbsit/slim-skeleton
- Owner: akbsit
- License: mit
- Created: 2018-10-07T17:46:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-17T08:34:45.000Z (almost 3 years ago)
- Last Synced: 2025-04-21T21:03:22.294Z (about 1 year ago)
- Topics: framework, php, slim, slim-framework
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slim-skeleton, [Packagist](https://packagist.org/packages/akbsit/slim-skeleton)
Framework PHP application based on Slim Framework.
Includes packages:
* [slim/slim](https://packagist.org/packages/slim/slim);
* [slim/twig-view](https://packagist.org/packages/slim/twig-view);
* [slim/csrf](https://packagist.org/packages/slim/csrf);
* [illuminate/validation](https://packagist.org/packages/illuminate/validation).
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
```
```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:
```php
$this->config->CUSTOM_CONFIG['CONFIG_NAME_1']
```