Eric C
Eric C

Reputation: 981

Renderer Post Processing (HTML Minification and CSS Inlining)

I'm not really sure how to approach this problem. I'm generating emails via lithium and would like to inline the css styles after the view/template has fully rendered before it's displayed in the browser.

It's very simple when building the view manually, using the Emogrifier package:

$view = new lithium\template\View(array('paths' => $paths));
$raw = $view->render('all', $data, $render);
$inliner = new Pelago\Emogrifier($raw);
$inline = $inliner->emogrify();

I already have a custom Media::type() to render the email templates (using the Inky template language).

Upvotes: 3

Views: 99

Answers (0)

Related Questions