internations / type-jail-bundle
将约束对象限制为超级类型以进行模板化
v3.0.0
2022-05-26 20:48 UTC
Requires
- php: >=7.4
- internations/type-jail: ^2 || ^3
- symfony/dependency-injection: >=4.4
- symfony/http-kernel: >=4.4
- symfony/twig-bundle: >=4.4
Requires (Dev)
- internations/kodierungsregelwerksammlung: ~0.35
- phpunit/phpunit: ~9
- roave/backward-compatibility-check: ^5 || ^6
- symfony/framework-bundle: >=4.4
- symfony/proxy-manager-bridge: >=4.4
- symfony/templating: >=4.4
- symfony/yaml: >=4.4
This package is auto-updated.
Last update: 2024-08-27 01:29:33 UTC
README
在 Twig 模板中强制执行对象的超级类型合约
安装
使用 composer require internations/type-jail-bundle:*
安装。在您的 AppKernel.php
中添加 new InterNations\Bundle\TypeJailBundle\InterNationsTypeJailBundle()
以加载扩展包。
配置
inter_nations_type_jail:
enabled: # boolean (default: reflects the kernel.debug setting)
factory: # one of jail, super_type_jail, jail (default: jail)
types: # A map of type aliases to not use full qualified namespaces in a template
fileInfo: SplFileInfo
用法
{% set file = jail(file, 'fileInfo') %}
{% set files = jail_aggregate(files, 'fileInfo') %}