Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -29,7 +29,7 @@ If you want a specific version, use the following syntax: `npm install mjml@4.7.
<?php
require_once 'vendor/autoload.php';

$renderer = new \Qferrer\Mjml\Renderer\BinaryRenderer(__DIR__ . '/node_modules/.bin/mjml');
$renderer = new \Qferrer\Mjml\Renderer\BinaryRenderer();

$html = $renderer->render('
<mjml>
Expand Down
3 changes: 2 additions & 1 deletion src/Renderer/BinaryRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down