iqual / symfony-extra-bundle
此包的最新版本(1.0.3)没有可用的许可证信息。
1.0.3
2016-07-30 19:26 UTC
Requires
- symfony/symfony: ^2.6 | ^3.0
Suggests
- hipaway-travel/mandrill-bundle: to use Mandrill mailer
- tijsverkoyen/css-to-inline-styles: to use CSS clases in email messages
README
为 Symfony 提供常见扩展。
安装
composer require mpom/symfony-extra-bundle
添加到 AppKernel.php
public function registerBundles() { $bundles = array( // ... new SymfonyExtraBundle\SymfonyExtraBundle, // ... ) }
配置
在您的 parameters.yml 文件中添加 2 个新选项
locale: en # default locale locales: [en, de, it, fr] # all supported locales
里面有什么?
区域自动检测器
使用不同的策略(按此顺序)检测用户的区域
- 查询
- Cookie
- 接受头
提供 LocaleManger 服务 (@se_locale_manager)
Twig
分页功能
提供分页功能以渲染分页;D
{{ pagination(totalItems, itemsPerPage, route, currentPage = 1, template ='SymfonyExtraBundle::pagination.html.twig') }}
货币过滤器
将字符串格式化为货币并附加货币符号(基于区域)。
{{ value|money }} # CHF 1'200.00
SwiftMailer
####传输
#####Mandrill 需要安装 "hipaway-travel/mandrill-bundle" 包
#####文件 需要设置 "mailer_local_dir" 参数。
####插件: #####CssToInline 从外部 CSS 文件提取样式为每个 HTML 消息的行内样式,需要 "tijsverkoyen/css-to-inline-styles"。
将 "symfony_extra" 部分的 "email_css_file" 选项设置为有效的 *.less 文件。