定制 jdifool/tempest-fluid-view 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jdifool/tempest-fluid-view

Composer 安装命令:

composer require jdifool/tempest-fluid-view

包简介

A Fluid view renderer for Tempest PHP.

README 文档

README

A TYPO3 Fluid template engine integration for Tempest PHP.

Requirements

  • PHP 8.4+
  • Tempest Framework 2.0+

Installation

composer require jdifool/tempest-fluid-view

Configuration

1. Configure Fluid Paths

Create a configuration file for Fluid template paths:

<?php
// app/fluid.config.php

declare(strict_types=1);

use Jdifool\Tempest\View\Renderers\FluidConfig;

return new FluidConfig(
    templateRootPaths: [
        __DIR__ . '/../views/Templates/',
    ],
    partialRootPaths: [
        __DIR__ . '/../views/Partials/',
    ],
    layoutRootPaths: [
        __DIR__ . '/../views/Layouts/',
    ]
);

2. Set Fluid as the View Renderer

Update your view configuration to use the Fluid renderer:

<?php
// app/view.config.php

declare(strict_types=1);

use Tempest\View\ViewConfig;
use Jdifool\Tempest\View\Renderers\FluidViewRenderer;

return new ViewConfig(
    rendererClass: FluidViewRenderer::class
);

Usage

Use Fluid templates in your controllers:

<?php
// app/HomeController.php

namespace App;

use Tempest\Router\Get;
use Tempest\View\View;
use function Tempest\view;

final readonly class HomeController
{
    #[Get('/')]
    public function __invoke(): View
    {
        return view('Home/Index', foo: 'bar');
    }
}

This renders views/Templates/Home/Index.html.

Resources

License

MIT

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-30