skcms / contact-bundle
SOLID-kiss 开发的 Symfony Contact Bundle
dev-master
2018-04-19 10:37 UTC
Requires
- php: >=5.3.2
- doctrine/doctrine-bundle: *
- skcms/core-bundle: dev-master
- symfony/framework-bundle: >=2.3-dev
- twig/twig: *
This package is auto-updated.
Last update: 2024-09-20 04:28:59 UTC
README
此包目前处于开发中,将很快提供更多文档和功能。
SKCMS for Symfony2 的联系包
安装
安装 skcms:core-bundle
启动 symfony 命令创建消息实体。
php app/console skcms:generate:entity
基本消息实体已包含:日期、状态、电子邮件、姓名、主题、消息、电话、传真
在 config.yml 中设置这些选项
skcms_admin:
modules:
contact:
enabled: true
messageEntity:
name: #name of your created message entity
beautyName: #name you want to see in the menu
bundle: #bundle name (by ex : SKCMSContact )
class: #the class name with full namespace
form: #the class name with full namespace
listProperties: #those are the proerties you want to see in the contact message list of your admin panel (date and status are automaticly displayed)
email:
dataName: 'email'
beautyName: 'E-mail'
type: 'string'
使用方法
###该表单在 twig 中通过 "contactForm" 变量全局可访问,任何页面都可以使用。要显示表单,只需编写
{{contactForm|raw}}
消息的提交和持久化是完全自动的。
###覆盖表单视图
只需覆盖该包,并在 Resources\views\Form\contact-form-content.html.twig 中创建自己的视图。