wtf / html
WTF 框架的 HTML 包
1.0.4
2018-03-28 08:28 UTC
Requires
- akrabat/rka-slim-session-middleware: ^2.0
- kanellov/slim-twig-flash: ^0.2.0
- slim/csrf: ^0.8.2
- slim/flash: ^0.2.0
- slim/twig-view: ^2.2
- wtf/core: ^1
Replaces
- tisuit/html: *
This package is auto-updated.
Last update: 2024-09-13 22:35:47 UTC
README
此包包含 WTF 框架的 Twig 模板引擎、闪存消息和有用的 Session 类
安装
通过 Composer 安装
composer require wtf/html
配置您的应用程序
创建配置文件 html.php
<?php declare(strict_types=1); $cache_dir = __DIR__.'/../cache'; return [ 'template_path' => __DIR__.'/../views/', 'cache_path' => __DIR__.'/../cache', ];
可选:创建 csrf.php
配置
<?php declare(strict_types=1); return [ 'failure_callable' => function ($request, $response, $next) { //@link https://github.com/slimphp/Slim-Csrf#handling-validation-failure $request = $request->withAttribute("csrf_status", false); return $next($request, $response); } ];
添加新的提供者和中间件
- 将
\Wtf\Html\Provider
添加到您的提供者列表中(suit.php
配置) - 将
session_middleware
和csrf_middleware
添加到您的中间件列表中(suit.php
配置) - 在您的公开
index.php
中添加session_start()
文档
插件目前扩展了以下插件。有关如何在您的应用程序中使用它们的说明链接如下。