References Getting Started Getting Started Architecture Architecture Application Application Window Window WebView WebView Deployment Deployment Components Components Framework Integrations Framework Integrations Examples Examples Community Community github GitHub github Get Started arrow_up_right
Getting Started Getting Started Architecture Architecture Application Application Window Window WebView WebView Deployment Deployment Components Components Framework Integrations Framework Integrations Examples Examples Community Community

Framework Integrations

Symfony HTTP Adapter Laravel HTTP Adapter PSR HTTP Adapter Getting Started Architecture Application Window WebView Deployment Components Framework Integrations Examples Community

Symfony HTTP Adapter

The Symfony HTTP Bridge provides the ability to convert internal requests and responses of the Schema API to those compatible with the Symfony Framework.

This bridge is NOT included by default in the boson-php/runtime and must be installed separately.

Installation

Via Composer:

composer require boson-php/symfony-http-bridge

Requirements:

  • PHP ^8.4
  • symfony/http-foundation ^6.4|^7.0

Usage

To work with Symfony HTTP kernel you can use specific Boson\Bridge\Symfony\Http\SymfonyHttpAdapter adapter.

use Boson\Application;
use Boson\ApplicationCreateInfo;
use Boson\Bridge\Symfony\Http\SymfonyHttpAdapter;
use Boson\WebView\Api\Schemes\Event\SchemeRequestReceived;

// Create an application
$app = new Application(new ApplicationCreateInfo(
    schemes: [ 'symfony' ],
));

// Create Symfony HTTP adapter
$symfony = new SymfonyHttpAdapter();

// Subscribe to receive a request
$app->on(function (SchemeRequestReceived $e) use ($symfony): void {
    $symfonyRequest = $symfony->createRequest($e->request);
    
    // ...do something, like:
    //
    // $kernel->boot();
    // $symfonyResponse = $kernel->handle($symfonyRequest);
    //
    
    $e->response = $symfony->createResponse($symfonyResponse);
    
    // if ($kernel instanceof TerminableInterface) {
    //     $kernel->terminate($symfonyRequest, $symfonyResponse);
    // }
});

$app->webview->url = 'symfony://app/example';
github discord telegram Get started Documentation Contribution Guide License Release Notes BOSON PHP © 2025. All Rights Reversed.