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.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
useSlimFacades\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();
classMyFacadeextendsSlimFacades\Facade{
// return the name of the component from the DI containerprotectedstaticfunctiongetFacadeAccessor(){ return'my_component'; }
}