useralberto/craft-base64-filters
最新稳定版本:1.0.1
Composer 安装命令:
composer require useralberto/craft-base64-filters
包简介
The plugin adds filters to Twig to encode and decode a string in base64.
README 文档
README
The plugin adds filters to Twig to encode and decode a string in base64.
The plugin is inspired by String Base64 for reasons that are explained issues is that it was decided to make this plugin for craft cms 4.
Requirements
This plugin requires Craft CMS 4.3.6.1 or later, and PHP 8.0.2 or later.
Installation
You can install this plugin from the Plugin Store or with Composer.
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “Base64 filters”. Then press “Install”.
With Composer
Open your terminal and run the following commands:
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require useralberto/craft-base64-filters # tell Craft to install the plugin ./craft plugin/install base64-filters
Using Base64 filters
Encoding
Input:
{{ 'Hola mundo'|base64enc }}
Output:
SG9sYSBtdW5kbw==
Decoding
Input:
{{ 'SG9sYSBtdW5kbw=='|base64dec }}
Output:
Hola mundo
Encrypts and base64-encodes
Input:
{{ 'Hola mundo'|base64encry }}
Output:
base64:Y3J5cHQ65VQ48cNrJesAzlRNO2EkkzQ4MmZjNDliYTE0YmJkMzNlZTU4NzQ3MjI2MmQxYmNmMmEwYjM2ODZhM2RlZjdkOWFkYTc4YTYwNDZmMDVjOGPlO1T5YKL3x7JWqlB6wkC86Stw0onxNcxFYwZfiTIRog==
Base64-decodes and decrypts
Input:
{{ 'base64:Y3J5cHQ65VQ48cNrJesAzlRNO2EkkzQ4MmZjNDliYTE0YmJkMzNlZTU4NzQ3MjI2MmQxYmNmMmEwYjM2ODZhM2RlZjdkOWFkYTc4YTYwNDZmMDVjOGPlO1T5YKL3x7JWqlB6wkC86Stw0onxNcxFYwZfiTIRog=='|base64decry }}
Output:
Hola mundo
统计信息
- 总下载量: 412
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-23