craftcms / hexdec
为Craft添加新的hexdec过滤器,该过滤器将十六进制值转换为十进制。
3.1.0
2024-03-19 23:25 UTC
Requires
- craftcms/cms: ^4.0.0-RC3|^5.0.0-beta.1
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- craftcms/rector: dev-main
This package is auto-updated.
Last update: 2024-09-20 00:30:27 UTC
README
此插件为Craft添加了新的|hexdec
Twig过滤器,该过滤器可以将十六进制值转换为十进制。
它是PHP的hexdec()函数的包装器。
{% set r = entry.colorField[1:2]|hexdec %} {% set g = entry.colorField[3:2]|hexdec %} {% set b = entry.colorField[5:2]|hexdec %}
要求
此插件需要Craft CMS 4.0.0+或5.0.0+。
安装
您可以从插件商店或使用Composer安装此插件。
从插件商店
转到您项目控制面板中的插件商店,搜索“Hexdec”,然后在模态窗口中点击“安装”按钮。
使用Composer
打开终端并运行以下命令
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require craftcms/hexdec # tell Craft to install the plugin ./craft install/plugin hexdec