Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 597 Bytes

config.md

File metadata and controls

30 lines (25 loc) · 597 Bytes

Config

Introduction

$key = 'app.debug';
config(); // \TinyFramework\Core\Config
config($key); // return value or null
config($key, 'value'); // set key to value and return \TinyFramework\Core\Config 
config()->get($key); // mixed|null
config()->set($key, $value); // \TinyFramework\Core\Config

Example

File: config/example.php

<?php declare(strict_types=1);

return [
    'test' => 1
];

Some other File

config('example.test'); // 1
config('example.test', 2); // \TinyFramework\Core\Config
config('example.test'); // 2