PHP code example of weew / app

1. Go to this page and download the library: Download weew/app 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/ */

    

weew / app example snippets


$app = new App('environment');

// or

$app = new App();
$app->setEnvironment('environment');

// get depdency injection container
$app->getContainer();

// get kernel
$app->getKernel();

// get event bus
$app->getEventer();

// get command bus
$app->getCommander();

// get config
$app->getConfigLoader()
    ->addPath('/path/to/config')
    ->addRuntimeConfig(['some' => 'value']);

// "dev" by default
$app->getEnvironment();
$app->setEnvironment('test');
// will be set to test
$app->getConfig()->get('env');

// false by default
$app->getDebug();
$app->setDebug(true);
// will be set to true
$app->getConfig()->get('debug');