Twig filters to base64 encode/decode a string.
This plugin requires Craft CMS 3.1.0 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project -
Then tell Composer to load the plugin:
composer require cavellblood/string-base64 -
In the Control Panel, go to Settings → Plugins and click the “Install” button for String Base64.
Input:
{{ "some string" | base64enc }}
Output:
c29tZSBzdHJpbmc=
Input:
{{ "c29tZSBzdHJpbmc=" | base64dec }}
Output:
some string
Brought to you by Cavell L. Blood