PHPackages                             rompetomp/inertia-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rompetomp/inertia-bundle

AbandonedArchivedSymfony-bundle[API Development](/categories/api)

rompetomp/inertia-bundle
========================

A Symfony adapter for Inertia.js

v2.4.3(2y ago)154133.7k—5.8%41[2 PRs](https://github.com/rompetomp/inertia-bundle/pulls)3MITPHPPHP ^7.3|^8

Since Aug 10Pushed 2y ago6 watchersCompare

[ Source](https://github.com/rompetomp/inertia-bundle)[ Packagist](https://packagist.org/packages/rompetomp/inertia-bundle)[ RSS](/packages/rompetomp-inertia-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (25)Used By (3)

Inertia.js Symfony Adapter
==========================

[](#inertiajs-symfony-adapter)

[![CI](https://github.com/rompetomp/inertia-bundle/workflows/CI/badge.svg)](https://github.com/rompetomp/inertia-bundle/actions)[![StyleCI](https://camo.githubusercontent.com/7b2a3625cc7b9f1f6f94e5397ef93fa77b9d70c15590e89e6a852e560120fda6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230313438343235332f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/201484253)

This is a Inertia.js server-side adapter based on [inertia-laravel](https://github.com/inertiajs/inertia-laravel), but for Symfony 5 and 6.

Warning

### Looking for a new owner

[](#looking-for-a-new-owner)

As I don't work with Symfony or PHP anymore, I'm looking for someone who wants to take over the development of this project. As of now the project is unmaintained.

Installation
------------

[](#installation)

First, make sure you have the twig, encore and serializer recipe:

```
composer require twig encore symfony/serializer-pack
```

Install using Composer:

```
composer require rompetomp/inertia-bundle
```

```
yarn add @inertiajs/inertia
```

Setup root template
-------------------

[](#setup-root-template)

The first step to using Inertia is creating a root template. We recommend using `app.html.twig`. This template should include your assets, as well as the `inertia(page)` function

```

    {% block stylesheets %}
        {{ encore_entry_link_tags('app') }}
    {% endblock %}
    {{ inertiaHead(page) }}

{{ inertia(page) }}
{% block javascripts %}
    {{ encore_entry_script_tags('app') }}
{% endblock %}

```

The `inertia(page)` function is a helper function for creating our base `div`. It includes a `data-page` attribute which contains the initial page information. This is what it looks like:

```
