PHPackages                             crenspire/yii2-inertia - 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. crenspire/yii2-inertia

ActiveLibrary

crenspire/yii2-inertia
======================

Inertia.js adapter for Yii2 framework

1.0.0(5mo ago)324MITPHPPHP ^8.1CI failing

Since Nov 28Pushed 5mo agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Yii2 Inertia.js Adapter
=======================

[](#yii2-inertiajs-adapter)

[![CI](https://github.com/crenspire/yii2-inertia/workflows/CI/badge.svg)](https://github.com/crenspire/yii2-inertia/actions)

An Inertia.js adapter for Yii2 framework, providing a seamless bridge between your Yii2 backend and modern JavaScript frontend frameworks (React, Vue, Svelte).

Features
--------

[](#features)

- 🚀 **Simple API**: Match the developer experience of `inertia-laravel`
- 📦 **Shared Props**: Share data across all Inertia responses
- 🔄 **Partial Reloads**: Support for partial page updates
- 🎯 **Asset Versioning**: Automatic version management for cache busting
- 🧪 **Well Tested**: Comprehensive unit and integration tests
- 📚 **Full Documentation**: Complete usage examples and guides

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

[](#installation)

Install via Composer:

```
composer require crenspire/yii2-inertia
```

Quick Start
-----------

[](#quick-start)

### 1. Configure Your Application

[](#1-configure-your-application)

In your `config/web.php`, register the Inertia view renderer:

```
'view' => [
    'renderers' => [
        'inertia' => \Crenspire\Yii2Inertia\ViewRenderer::class,
    ],
],
```

### 2. Create Root View Template

[](#2-create-root-view-template)

Create a root view template at `views/layouts/inertia.php`:

```
DOCTYPE html>

    Inertia.js App
