ccc / email-template-bundle
用于快速整合数据库中管理的电子邮件模板的Twig扩展
dev-master
2014-09-16 15:42 UTC
Requires
- php: >=5.3.2
- friendsofsymfony/jsrouting-bundle: ~1.4
- symfony/symfony: ~2.2
This package is not auto-updated.
Last update: 2024-09-23 15:21:49 UTC
README
带有Ajax(使用jQuery)的电子邮件模板表单类型,用于填充textarea字段和列表/插入/更新/删除页面以管理在Doctrine管理的数据库中的电子邮件模板。高度实验性,可能随时更改。风险自负。
安装
将包添加到依赖项
{ "require": { "ccc/email-template-bundle": "dev-master" ... } }
在您的内核中注册包
public function registerBundles() { $bundles = array( // ... new FOS\JsRoutingBundle\FOSJsRoutingBundle(), new CCC\EmailTemplateBundle\EmailTemplateBundle(), // ... );
更新您的包
$ php composer.phar update
更新您的数据库模式
$ php app/console doctrine:schema:update
添加路由
# app/config/routing.yml ccc_email_template: resource: "@CCCEmailTemplateBundle/Resources/config/routing.yml" prefix: /
翻译
如果您想使用此包提供的默认文本,请确保您的配置中启用了翻译器。
# app/config/config.yml framework: translator: ~
使用方法
在数据库中填充一些模板后,您可以
$builder ->add('email_template', 'email_template_select', array( 'required' => false, 'label' => 'email' ));
查看 /email-template/select 以获取示例
路由
在 config/routing/emailtemplate.yml 中可用
/email-template/
- 列出所有可用的模板/email-template/new
- 创建新的模板/email-template/{id}/show
- 显示模板的详细信息/email-template/{id}/edit
- 编辑模板/email-template/{id}/delete
- 删除模板