wtf / html
HTML package for WTF Framework
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-12-13 23:08:02 UTC
README
This package contains Twig template engine with flash messages and a useful Session class for WTF framework
Installation
Install via Composer
composer require wtf/html
Configure your app
Create config file html.php
:
<?php declare(strict_types=1); $cache_dir = __DIR__.'/../cache'; return [ 'template_path' => __DIR__.'/../views/', 'cache_path' => __DIR__.'/../cache', ];
Optional: create csrf.php
config:
<?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); } ];
Add new provider and middleware
\Wtf\Html\Provider
into your providers list (suit.php
config)session_middleware
andcsrf_middleware
into your middlewares list (suit.php
config)- Add
session_start()
in your publicindex.php
Documentation
Plugin is currently extended with the following plugins. Instructions on how to use them in your own application are linked below.