qferr / mjml-twig Goto Github PK
View Code? Open in Web Editor NEWMJML extension for Twig
Home Page: https://qferrer.medium.com/using-mjml-with-twig-cccea9af0086
MJML extension for Twig
Home Page: https://qferrer.medium.com/using-mjml-with-twig-cccea9af0086
Sadly, it is not working w/ symfony 5.
Using version ^1.0 for qferr/mjml-twig
./composer.json has been updated
Running composer update qferr/mjml-twig
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "5.2.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires qferr/mjml-twig ^1.0 -> satisfiable by qferr/mjml-twig[1.0.0].
- qferr/mjml-twig 1.0.0 requires twig/twig ~2.0 -> found twig/twig[v2.0.0, ..., 2.x-dev] but the package is fixed to v3.3.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
affected composer settings:
...
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
...
I just upgrade my project from Symfony 5.4 to Symfony 6 and i encounter this issue.
Qferrer\Mjml\Twig\MjmlExtension::__construct():
Argument #1 ($renderer) must be of type Qferrer\Mjml\Renderer\RendererInterface,
Qferrer\Mjml\Renderer\BinaryRenderer given
My services.yaml:
mjml_renderer:
class: Qferrer\Mjml\Renderer\BinaryRenderer
arguments:
- '%kernel.project_dir%/node_modules/.bin/mjml'
Qferrer\Mjml\Twig\MjmlExtension:
arguments: ['@mjml_renderer']
tags: ['twig.extension']
UPDATE:
But fresh new Symfony 6 project have no issue at all, not sure what is the culprit causing argument type error. Any clue?
It is because the current code using Qferrer\Mjml\Renderer\RendererInterface
but the real namespace is Qferrer\Mjml\RendererInterface
. PR will be create shortly.
I think you should add a LICENSE file to this repository (and mjml-php) to make it truly open source. It also allows to make an agreement between you and your users so that they are free to use your library.
https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository
Thank you.
This script initially looked promising; however, it appears to be broken / non-functional. I'm using the instructions in the Medium article: https://medium.com/@qferrer/using-mjml-with-twig-cccea9af0086
When you try to install it, you'll get this error:
The ONLY way I could install it was downgrade to Twig 2.0 and add minimum-stability: dev to my composer.json file.
And if you try to run it, you get this error:
No matter what I tried, I couldn't get this script to function at all. Even tried switching to your "https://github.com/qferr/mjml-php" extension -- but ran into the exact same issue.
Twig: 2.12.5
PHP: 7.4.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.