PHP code example of techsterx / slim-config-yaml

1. Go to this page and download the library: Download techsterx/slim-config-yaml library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

techsterx / slim-config-yaml example snippets





re 'Yaml.php';

$app = new \Slim\Slim();

\BurningDiode\Slim\Config\Yaml::getInstance()->addFile('/path/to/some/file');

$slimYaml = \BurningDiode\Slim\Config\Yaml::getInstance();

$slimYaml = \BurningDiode\Slim\Config\Yaml::_();

\BurningDiode\Slim\Config\Yaml::getInstance()->addFile('/path/to/some/file.yaml');

\BurningDiode\Slim\Config\Yaml::getInstance()
    ->addFile('/path/to/some/file.yaml')
    ->addFile('/path/to/another/file.yaml');

\BurningDiode\Slim\Config\Yaml::getInstance()->addDirectory('/path/to/directory');

\BurningDiode\Slim\Config\Yaml::getInstance()
    ->addDirectory('/path/to/directory')
    ->addFile('/path/to/some/file.yaml');

\BurningDiode\Slim\Config\Yaml::_()
    ->addParameters(array('app.root' => dirname(__FILE__)))
    ->addDirectory('/path/to/config/directory')
    ->addFile('/path/to/file/outside/of/config/directory.yml');

\BurningDiode\Slim\Config\Yaml::_()->addFile('config.yml');

$config = $app->config('application');

print_r($config);

\BurningDiode\Slim\Config\Yaml::_()->addFile('database.yml');

$db_config = $app->config('database');

print_r($db_config);

curl -s https://getcomposer.org/installer | php

php composer.phar install
index.php
index.php