leafs/inertia
最新稳定版本:v4.3
Composer 安装命令:
composer require leafs/inertia
包简介
Leaf PHP adapter for inertia JS
README 文档
README
Leaf + Inertia
This is a simple package that helps you use Inertia.js with Leaf. It provides a Inertia class that makes it easy to return Inertia responses from your Leaf controllers and output Inertia template in your Leaf views.
Since Leaf supports multiple templating engines, inertia uses the engine configured in your view config.
Installation
Note: This is already done for you in Leaf MVC.
Since this is the server-side adapter for Leaf, you need to install Inertia for whatever framework you're using on the client-side. You can find a list on the Inertia website.
npm install @inertiajs/react
After this, you can add the Leaf adapter to your project using the Leaf CLI:
leaf install inertia
Or with composer:
composer require leafs/inertia
Usage
To get started, you need replace your Leaf view with the Inertia component. In place of your default Leaf view, you should return the Inertia::render method. This method accepts the name of your component as its first argument, and an array of data as its second argument:
app()->get('/', function() { return Inertia::render('Home', [ 'name' => 'Leaf' ]); });
Full docs on the leaf docs.
统计信息
- 总下载量: 1.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-05