From efe5e9826ee86660fee1c1b57cac40bd4e00d701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Paix=C3=A3o?= Date: Sat, 25 Jun 2022 16:41:42 -0300 Subject: [PATCH 1/2] Fix: Path load node_modules bin --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 62daebe..2e40a1b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -MJML in PHP -=========== +# MJML in PHP ![PHPUnit](https://github.com/qferr/mjml-php/actions/workflows/php.yml/badge.svg) A simple PHP library to render MJML to HTML. There are two ways for integrating MJML in PHP: -* using the MJML API -* using the MJML library + +- using the MJML API +- using the MJML library ### Installation @@ -29,7 +29,7 @@ If you want a specific version, use the following syntax: `npm install mjml@4.7. render(' From cd64a22f2d72a976d2643ff0feae26a6daa67a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Paix=C3=A3o?= Date: Sat, 25 Jun 2022 16:46:00 -0300 Subject: [PATCH 2/2] Fix: Practicality of use --- README.md | 2 +- src/Renderer/BinaryRenderer.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e40a1b..a263d7c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ If you want a specific version, use the following syntax: `npm install mjml@4.7. render(' diff --git a/src/Renderer/BinaryRenderer.php b/src/Renderer/BinaryRenderer.php index d572d78..17e8f89 100644 --- a/src/Renderer/BinaryRenderer.php +++ b/src/Renderer/BinaryRenderer.php @@ -36,8 +36,9 @@ public function __construct(string $bin) /** * @inheritDoc */ - public function render(string $content): string + public function render(string $content = null): string { + if (empty($content)) $content = getcwd() . '/node_modules/.bin/mjml'; $process = new Process($this->command, $content); $process->run();