1. Go to this page and download the library: Download kynetcode/wpzylos-core 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/ */
$app = new Application($context);
// Register service providers
$app->register(new DatabaseServiceProvider());
$app->register(new RoutingServiceProvider());
// Boot the application
$app->boot();
// Resolve services from the container
$service = $app->make(MyService::class);
// Check if a service is bound
$app->has(MyService::class); // true/false
use WPZylos\Framework\Core\ServiceProvider;
use WPZylos\Framework\Core\Contracts\ApplicationInterface;
class MyServiceProvider extends ServiceProvider
{
public function register(ApplicationInterface $app): void
{
parent::register($app);
$this->singleton(MyService::class, function () {
return new MyService($this->context());
});
}
public function boot(ApplicationInterface $app): void
{
// Called after all providers are registered
$service = $this->make(MyService::class);
}
}