-
-
Notifications
You must be signed in to change notification settings - Fork 270
add a base64 encoding filter #54
Comments
Probably a binding to this lib is a good way ? https://github.com/alchemy-fr/PHP-dataURI @nlegoff This is for you |
(mime-type detection is missing) |
for mime-type detection you can check this Symfony2 classes/code: |
you are right. i tested this: some drawbacks:
|
Be carefull, your implementation does not check the string length to comply with RFC 2397 section 2 https://www.ietf.org/rfc/rfc2397.txt |
Here's my implementation, based on PHP-dataURI |
RFC 1866 Hypertext Markup Language - 2.0 November 1995 BC can be overdone :) |
👍 for this feature in the core! |
👍 |
4 similar comments
👍 |
👍 |
👍 |
👍 |
implemented in Twig core (see twigphp/Twig#3102) |
This PR was merged into the 2.x branch. Discussion ---------- Add the data_uri filter Implemented as a popular request here: closes twigphp/Twig-extensions#54 Commits ------- 220e750 added the data_uri filter
this can be convenient for inlining images. the filter should accept a variable containing a binary string, a stream resource and maybe also just a filename.
The text was updated successfully, but these errors were encountered: