library inline-css-provider
Silex provider which wraps the features of CssToInlineStyles
jandc/inline-css-provider
Silex provider which wraps the features of CssToInlineStyles
- Monday, December 11, 2017
- by jandc
- Repository
- 1 Watchers
- 2 Stars
- 308 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 12 % Grown
InlineCssProvider
Note: due to the (personal) need to be bolt.cm compliant; silex2 is not supported!!!
InlineCssProvider is a silex compliant serviceprovider of the CssToInlineStyles class by Tijs Verkoyen (https://github.com/tijsverkoyen/CssToInlineStyles)., (*1)
Additional feature(s) are:
* Direct rendering from twig., (*2)
Usage
- Base service: 'inlinecss.inlinecss'
-
Render service: 'inlinecss.render', (*3)
The base service is a simple wrapper, the renderservice resolves a twig template first (optional), (*4)
sample
$app->register(new InlineCssProvider(DIR.'/Resources/views/mails/css/main.css'));
, (*5)
, (*6)
$email = new \Swift_Message(
"Import failed on when processing the importfile",
$app['inlinecss.render]->renderAndInlineTemplate('mails/failed_import.twig')
, 'text/html');, (*7)
, (*8)