uegmobile / uuid-twig-extension-bundle
基于 ramsey/uuid bundle 的使用 uuid 函数的 Symfony twig 扩展包
v1.0.2
2022-11-16 09:10 UTC
Requires
- php: ^5.4||^7||^8
- ramsey/uuid: ^3.7||~4
- symfony/symfony: ^2.3||~3||~4||~5
This package is not auto-updated.
Last update: 2024-09-18 18:38:45 UTC
README
基于 ramsey/uuid bundle 的使用 uuid 函数的 Symfony twig 扩展包
安装
通过 composer 在您的 symfony 项目中安装
composer require uegmobile/uuid-twig-extension-bundle
在 Symfony <= 3 中,然后,通过添加以下行在您的 AppKernel 中注册该包:
new UEGMobile\UUIDTwigExtensionBundle\UUIDTwigExtensionBundle()
在 Symfony >= 4 中,然后,通过添加以下行在您的 bundle.php 文件中注册该包:
UEGMobile\UUIDTwigExtensionBundle\UUIDTwigExtensionBundle::class => ['all' => true]
twig 扩展
uuid 函数
- 链接函数到 ramsey/uuid
示例
在 twig 模板中打印新的 UUID
{{ uuid() }}