1. Go to this page and download the library: Download itsgoingd/slim-facades 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/ */
use SlimFacades\Facade;
$app = new Slim\Slim();
// initialize the Facade class
Facade::setFacadeApplication($app);
Facade::registerAliases();
// now you can start using the facades
Config::set('debug', true);
Route::get('/hello/:name', function($name)
{
View::display('hello.html', array(
'name' => Input::get('name', $name)
));
});
App::run();
class MyFacade extends SlimFacades\Facade
{
// return the name of the component from the DI container
protected static function getFacadeAccessor() { return 'my_component'; }
}