Download the PHP
package yii2-extensions/inertia without Composer
On this page you can find all versions of the php package
yii2-extensions/inertia. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Inertia.js server-side integration layer for Yii2 Server-driven pages, shared props, redirects, and asset version handling without jQuery
## Features
## Overview
`yii2-extensions/inertia` is the server-side base package for building modern Inertia-driven pages on top of Yii2.
It does not ship a client adapter. Instead, it defines the server contract that future packages such as
`yii2-extensions/inertia-vue`, `yii2-extensions/inertia-react`, and `yii2-extensions/inertia-svelte` can reuse.
## Installation
Register the bootstrap class in your application configuration:
## Quick start
Render a page directly from a controller action:
Or extend the convenience controller:
Or inject the renderer contract. `Bootstrap` binds `ResponseRendererInterface` to `InertiaRenderer` in the DI container,
so the action stays decoupled from the Inertia implementation and overlays (Inertia, JSON, API) can swap the renderer
without rewriting controller code:
## Configuration example
## Dev server support (Vite)
The bundled `\yii\inertia\Vite` helper component renders asset tags for both development and production. When `devMode`
is `true`, it emits `@vite/client` plus each configured entrypoint from `devServerUrl`, enabling Vite's HMR WebSocket
end-to-end. When `devMode` is `false`, it reads the manifest at `manifestPath` and renders hashed asset tags for
production.
Typical development flow: run `npm run dev` to start the Vite dev server and launch Yii2 with a dev environment flag
(for example, `YII_ENV=dev ./yii serve`). `YII_ENV` does not toggle `Vite::$devMode` on its own; your application
configuration must wire the two together, for example:
For framework-specific setup, see:
- [`yii2-extensions/inertia-react`](https://github.com/yii2-extensions/inertia-react) โ React Refresh preamble auto-injection.
- [`yii2-extensions/inertia-vue`](https://github.com/yii2-extensions/inertia-vue) โ Vue HMR (no extra preamble).
## Prop types (v3)
The package supports the Inertia v3 prop types for fine-grained control over when and how props are resolved:
See the [Usage Examples](docs/examples.md) for detailed documentation on each prop type.
## Validation and flash messages
This package maps the session flash key `errors` to `props.errors` and exposes all remaining flashes at the top-level
`flash` page key. A typical validation redirect looks like this:
## CSRF protection
Drop in `yii\inertia\web\Request` to enable Inertia's automatic cookie-to-header CSRF flow:
Inertia's HTTP client reads the `XSRF-TOKEN` cookie and sends it as `X-XSRF-TOKEN` automatically no client-side
configuration required. See the [Configuration Reference](docs/configuration.md) for details.
## Package boundaries
This repository intentionally does not include Vue, React, or Svelte bootstrapping. Those concerns belong in separate
client adapter packages built on top of the server contract defined here.
## Documentation
For detailed configuration options and advanced usage.
- ๐ [Installation Guide](docs/installation.md)
- โ๏ธ [Configuration Reference](docs/configuration.md)
- ๐ก [Usage Examples](docs/examples.md)
- ๐งช [Testing Guide](docs/testing.md)
## Package information
[](https://www.php.net/releases/8.3/en.php)
[](https://github.com/yiisoft/yii2/tree/22.0)
[](https://packagist.org/packages/yii2-extensions/inertia)
[](https://packagist.org/packages/yii2-extensions/inertia)
## Quality code
[](https://codecov.io/github/yii2-extensions/inertia)
[](https://github.com/yii2-extensions/inertia/actions/workflows/static.yml)
[](https://github.com/yii2-extensions/inertia/actions/workflows/linter.yml)
[](https://github.styleci.io/repos/1196150046?branch=main)
## License
[](LICENSE)
Requiresphp Version
>=8.3 yiisoft/yii2 Version
^22.0@dev
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package yii2-extensions/inertia contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.