Search by

Yii2 adapter for the framework-agnostic Inertia.js PHP protocol core.

Package info

github.com/yii2-extensions/inertia

pkg:composer/yii2-extensions/inertia

Statistics

Installs: 3 897

Dependents: 5

Suggesters: 1

Stars: 3

Open Issues: 0

0.6.1 2026-10-18 13:42 UTC

This package is auto-updated.

Last update: 2026-10-18 13:46:47 UTC


README

Yii Framework

Inertia for Yii2


PHPUnit Mutation Testing PHPStan Security

Connect Yii requests, responses, views, sessions, and redirects to the Inertia protocol

Architecture

php-forge/inertia owns the Inertia protocol, page model, prop resolution, headers, redirects, and result objects. This package connects that core to Yii requests, responses, views, and sessions. The application supplies its JavaScript client, component resolver, and asset build.

Installation

Yii 2.0.x is outside this package's declared support.

composer require yii2-extensions/inertia:^0.6

See the installation guide for Yii development-line resolution, bootstrap registration, CSRF configuration, and frontend setup.

Quick start

Register the adapter in the existing web application configuration:

'bootstrap' => [\yii\inertia\Bootstrap::class],

Return a page from an existing controller action:

return \yii\inertia\Inertia::render('Dashboard', ['stats' => ['visits' => 42]]);

A normal visit renders HTML; an Inertia visit returns a JSON page. The default view supplies the page payload but loads no frontend bundle. Continue with configuration and the usage examples to connect the application's client.

Documentation

Practical guides and application recipes, with exact contracts in PHPDoc.

AI assistance

AI agents: use the repository guides and package skill below. When hosted documentation is available, start at https://yii2-framework.github.io/docs/llms.txt and fetch a listed page's Markdown by appending index.md to its URL.

For the Yii 22 conventions this package builds on, use the yii2-framework agent skill from a local yii2-framework/docs checkout (skills/yii2-framework/SKILL.md).

If hosted sources are unavailable, use the repository guides and the locally available package skill.

Package information

PHP Yii 22.0.x Latest Stable Version Total Downloads

Project status

Codecov PHPStan Level Max Quality StyleCI

Our social networks

Follow on X Follow on Facebook Join our Subreddit Join on Telegram

License

License