1. Go to this page and download the library: Download statical/slim-static 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 Slim\Slim;
use Statical\SlimStatic\SlimStatic;
$app = new Slim();
SlimStatic::boot($app);
# Allow any registered proxy to be called anywhere in the `App\Name` namespace
Statical::addNamespace('*', 'App\\Name\\*');
App::expires('+1 week');
App::halt();
$debug = Config::get('debug');
Config::set('log.enable', true);
# Note that you could also use:
$debug = App::config('debug');
App::config('log.enable', true);
# create our PaymentService class
$instance = new \PaymentService();
$alias = 'Payment'; # The static alias to call
$proxy = 'PaymentProxy'; # The proxy class you just created
Statical::addProxyInstance($alias, $proxy, $instance);
# Now we can call PaymentService methods via the static alias Payment
Payment::process();
# Register our service with Slim's DI container
Container::set('payment', function () {
return new \PaymentService();
});
$alias = 'Payment'; # The static alias to call
$proxy = 'PaymentProxy'; # The proxy class you just created
$id = 'payment'; # The id of our service in the Slim container
Statical::addProxyService($alias, $proxy, Container::getInstance(), $id);
# Now we can call PaymentService methods via the static alias Payment
Payment::process();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.