stafox/zurb-ink-bundle
Composer 安装命令:
composer require stafox/zurb-ink-bundle
包简介
Creating email templates is hard. This Bundle provides help.
README 文档
README
WARNING: this is only a Extended-Fork of "https://github.com/thampe/ZurbInkBundle"
ZurbInkBundle (Foundation for Emails 2)
Creating email templates is hard. This Symfony Bundle provides some help:
- Foundation for Emails 2 Integration for awesome and responsive emails. Checkout their documentation.
- Use normal CSS files for styling, add them via
{{ zurb_ink_styles.add("@YourBundle/Resources/public/css/styles.css") }}. - Automatic inline styles via the
{% ìnlinestyle %}tag (powered by Tijs Verkoyen's CssToInlineStyles Fork by voku). - Imports your CSS rules also in html head via
{{ includeStyles(zurb_ink_styles) }} - New in 2.0: Inky-Template Support via the
{% inky %}tag (powered by https://github.com/thampe/inky)
Installation
You can install this bundle using composer
composer require stafox/zurb-ink-bundle
or add the package to your composer.json file directly.
Php 7.0 is now required. Make sure your composer.json, does not set the platform to php < 7.0:
"config": {
"bin-dir": "bin",
"platform": {
"php": "7.0"
}
},
After you have installed the package, you just need to add the bundle to your AppKernel.php file:
// in AppKernel::registerBundles()
$bundles = array(
// ...
new Stafox\ZurbInkBundle\StafoxZurbInkBundle(),
// ...
);
Usage
Option A: Extend the base.html.twig
If you want to use the zurb ink framework, extend the StafoxZurbInkBundle::base.html.twig.
{% extends 'StafoxZurbInkBundle:FoundationForEmails:2/base.html.twig' %}
{% block preHtml %}
{# add your css files here, please use a bundle relative path #}
{{ zurb_ink_styles.add("@YourBundle/Resources/public/css/style1.css") }}
{{ zurb_ink_styles.add("@YourBundle/Resources/public/css/style2.css") }}
...
{% endblock %}
{% block content %}
{# html #}
{% endblock %}
{% extends 'StafoxZurbInkBundle::base.html.twig' %}
Note: If you prefer not to have the CSS-Styles also in the <head> of your HTML-Document, you can override the
headStyles-Block: {% block headStyles %}{% endblock %}. Be aware that some CSS-Rules can't be realized with
inline-styles, like :hover-States or @media-Queries (both uesed by ZURB Ink Framework)!
Option B: Write your own template from scratch
{% spaceless %}
{# add your styles before the inlinestyle tag #}
{{ zurb_ink_styles.add("@YourBUndle/Resources/public/css/style.css") }}
{% inlinestyle %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
{% block headStyles %}
<style type="text/css">
{% autoescape false %}
{{ includeStyles(zurb_ink_styles) }}
{% endautoescape %}
</style>
{% endblock %}
</head>
{% inky %} {# inky-tag for inky-template support #}
<body>
{% block body %}
<table class="body">
<tr>
<td class="center" align="center" valign="top">
<center>
{% block content %}
{% endblock %}
</center>
</td>
</tr>
</table>
<!-- prevent Gmail on iOS font size manipulation -->
<div style="display:none; white-space:nowrap; font:15px courier; line-height:0;"> </div>
{% endblock %}
</body>
{% endinky %}
</html>
{% endinlinestyle %}
{% endspaceless %}
License
See the LICENSE file for license info (it's the MIT license).
stafox/zurb-ink-bundle 适用场景与选型建议
stafox/zurb-ink-bundle 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 12 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「template」 「email」 「zurb」 「ink」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 stafox/zurb-ink-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stafox/zurb-ink-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 stafox/zurb-ink-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Integrates the features of the responsive framework Foundation, from Zurb, into Symfony2 by providing templates, Twig extensions, services and commands.
TYPO3 extension for sending responsive email templates
A simple way to create breadcrumbs.
Extensible library for building notifications and sending them via different delivery channels.
Easy flash messages for Silverstripe
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-06