jandc / inline-css-provider
Silex provider which wraps the features of CssToInlineStyles
Installs: 1 046
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- silex/silex: >=1.2,<2.0
- tijsverkoyen/css-to-inline-styles: >=2.0
Requires (Dev)
- twig/twig: >=1.0
Suggests
- twig/twig: >=1.0
This package is auto-updated.
Last update: 2024-10-24 00:00:12 UTC
README
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).
Additional feature(s) are:
- Direct rendering from twig.
Usage
- Base service: 'inlinecss.inlinecss'
- Render service: 'inlinecss.render'
The base service is a simple wrapper, the renderservice resolves a twig template first (optional)
sample
$app->register(new InlineCssProvider(__DIR__.'/Resources/views/mails/css/main.css'));
$email = new \Swift_Message(
"Import failed on when processing the importfile",
$app['inlinecss.render]->renderAndInlineTemplate('mails/failed_import.twig')
, 'text/html');