helsingborg-stad/render-blade-view

用于渲染 Blade 组件的功能。

0.0.2 2023-03-23 06:13 UTC

This package is auto-updated.

Last update: 2024-09-23 12:44:05 UTC


README

Contributors Forks Stargazers Issues License

Logo

render-blade-view

用于渲染 PHP Blade 视图的功能。

报告错误 请求功能

使用 Composer 安装

composer require helsingborg-stad/render-blade-view

要求

  • PHP ^7.4

使用方法

class BladeEngine {
    // The bladeEngine to be passed to BladeView::create must have a render function following this signature.
    public function render(string $view, array $data):string;
}

$bladeEngine = new BladeEngine();
$view = 'foo';
$viewData = ['foo' => 'bar'];

$bladeView = BladeView::create($bladeEngine);
$bladeView->render($view, $viewData);

许可证

MIT 许可证 下分发。