Search by

evo-mark / inertia-symfony

evomark

Inertia.js adapter for Symfony

Package info

github.com/evo-mark/inertia-symfony

Homepage

Documentation

Type:symfony-bundle

pkg:composer/evo-mark/inertia-symfony

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-20 02:53 UTC

This package is auto-updated.

Last update: 2026-11-20 02:55:41 UTC


README

evoMark company logo

Downloads Version Licence

evo-mark/inertia-symfony

A Symfony bundle for building Inertia.js applications, including server-side rendering (SSR).

Requires PHP 8.4+ and Symfony 8.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and run:

composer require evo-mark/inertia-symfony

Applications that don't use Symfony Flex

Step 1: Download the bundle

Open a command console, enter your project directory and run this command to download the latest stable version of the bundle:

composer require evo-mark/inertia-symfony

Step 2: Enable the bundle

Enable the bundle by adding it to the list of registered bundles in your project's config/bundles.php file:

// config/bundles.php

return [
    // ...
    EvoMark\InertiaSymfonyBundle\EvoMarkInertiaSymfonyBundle::class => ['all' => true],
];

Then set up the frontend and the root template: see Getting started.

Usage

Render a page from a controller by injecting InertiaInterface:

use EvoMark\InertiaSymfonyBundle\Interfaces\InertiaInterface;
use Symfony\Component\Routing\Attribute\Route;

class HomeController
{
    #[Route('/', name: 'home')]
    public function __invoke(InertiaInterface $inertia)
    {
        return $inertia->render('Home', ['title' => 'Welcome']);
    }
}

Create the root template with bin/console inertia:view (add --force to overwrite). It is named after the root_view setting, app.html.twig by default, and outputs the page with the inertiaHead() and inertiaApp() Twig functions:

<head>
    {{ inertiaHead(page) }}
</head>
<body>
    {{ inertiaApp(page) }}
</body>

Configuration

Settings live under evo_mark_inertia_symfony in config/packages/evo_mark_inertia_symfony.yaml. All of them are optional:

evo_mark_inertia_symfony:
    root_view: app.html.twig
    ssr:
        enabled: false
        url: http://127.0.0.1:13714
        throw_on_error: false

Run bin/console config:dump-reference evo_mark_inertia_symfony to see every option.

Testing

composer test

Licence

Released under the MIT licence.