2017 © Pedro Peláez
 

cakephp-plugin cakephp-inline-css

CakePHP inline CSS plugin

image

drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  • Saturday, January 14, 2017
  • by drmonkeyninja
  • Repository
  • 1 Watchers
  • 8 Stars
  • 20,017 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 13 % Grown

The README.md

CakePHP Inline CSS

License Build Status, (*1)

This plugin provides a CakePHP helper that uses CssToInlineStyles to convert HTML style blocks to inline CSS on a View template. Its intended use is with generating email templates where many email clients often require styles applied directly to the elements., (*2)

Requirements

  • CakePHP 3.x

Installation

This plugin should be installed using Composer:-, (*3)

composer require drmonkeyninja/cakephp-inline-css:3.0.*

Then add the following line to your bootstrap.php to load the plugin., (*4)

Plugin::load('InlineCss');

Usage

To use this plugin you want to load the InlineCss helper to use with your email's HTML template:-, (*5)

$email = new Email();
$email->template('welcome', 'fancy')
    ->emailFormat('html')
    ->helpers(['InlineCss.InlineCss'])
    ->to('bob@example.com')
    ->from('app@domain.com')
    ->send();

When rendering your email template the plugin will then convert any CSS defined in an inline <style> block in your template to inline CSS. So, if your email view template looks like this:-, (*6)

<style type="text/css">
    .link {color: red;}
</style>
<p><a href="http://andy-carter.com" class="link">Link</a></p>

It will be rendered as:-, (*7)

<p><a href="http://andy-carter.com" class="link" style="color: red;">Link</a></p>

This makes generating HTML emails a lot simpler as you can write your CSS in a more DRY approach., (*8)

I recommend you look consider deferring the sending of emails using something like the excellent Queue plugin to improve your app's response time for users when using this plugin., (*9)

The Versions

14/01 2017

dev-master

9999999-dev https://github.com/drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  Sources   Download

MIT

The Requires

 

css cakephp helper

30/11 2016
30/11 2016

3.x-dev

3.9999999.9999999.9999999-dev https://github.com/drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  Sources   Download

MIT

The Requires

 

css cakephp helper

02/02 2016

2.0.2

2.0.2.0 https://github.com/drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  Sources   Download

MIT

The Requires

 

css cakephp helper

13/01 2016

2.0.1

2.0.1.0 https://github.com/drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  Sources   Download

MIT

The Requires

 

css cakephp helper

04/01 2016

2.0.0

2.0.0.0 https://github.com/drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  Sources   Download

MIT

The Requires

 

css cakephp helper

04/01 2016

dev-travis

dev-travis https://github.com/drmonkeyninja/cakephp-inline-css

CakePHP inline CSS plugin

  Sources   Download

MIT

The Requires

 

css cakephp helper