jhse-labs/mezzio-twig-viewhelper
最新稳定版本:1.1.3
Composer 安装命令:
composer require jhse-labs/mezzio-twig-viewhelper
包简介
Bridges laminas view helpers to the twig environment when running a mezzio application
README 文档
README
Within mezzio applications, this module bridges the classic laminas view helpers to the twig environment enabled by mezzio-twigrenderer. You can use all laminas view helpers (e.g. for rendering laminas-form components) seamlessly from you twig templates.
This is inspired by kokspflanze/zfc-twig, the module that achieved this functionality for laminas-mvc.
Installation
Install the library using composer:
composer require jhse-labs/mezzio-twig-viewhelper
Enable the module in config.php:
<?php $aggregator = new ConfigAggregator([ \JhseLabs\MezzioTwigViewHelper\ConfigProvider::class, ...
The laminas view helper support is added to your Twig\Environment instance automatically via registering a delegator factory.
Usage
Within your Twig templates you can now call all your laminas view helpers:
<head> {{ headTitle('Login Page') }} </head> <body> {{ form(loginForm) }} </body>
Since version 1.1.0 it is possible to call laminas view helpers with named arguments:
{{ form(form=loginForm, method='POST') }}
统计信息
- 总下载量: 141
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-31