idci/contact-form-bundle
Composer 安装命令:
composer require idci/contact-form-bundle
包简介
Symfony ContactFormBundle
README 文档
README
Symfony2 contact form bundle and social sharing
Installation
To install this bundle please follow the next steps:
First add the dependencies to your composer.json file:
"require": { ... "pagerfanta/pagerfanta": "dev-master", "white-october/pagerfanta-bundle": "dev-master", "idci/contact-form-bundle": "dev-master" },
Then install the bundle with the command:
php composer update
Enable the bundle in your application kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), new IDCI\Bundle\ContactFormBundle\IDCIContactFormBundle(), ); }
As you can see, we use WhiteOctoberPagerFantaBundle to paginate list results. So you have to define the max_per_page parameter in your app/config/parameters.yml
parameters: ... max_per_page: 25
Add needed routes in the app/config/routing.yml to use this bundle with all your forms anywhere
idci_contact_form_api: resource: "../../vendor/idci/contact-form-bundle/IDCI/Bundle/ContactFormBundle/Controller/ApiController.php" type: annotation
If you wish access to an administration space, add this following controllers:
idci_contact_form_admin: resource: "../../vendor/idci/contact-form-bundle/IDCI/Bundle/ContactFormBundle/Controller/AdminController.php" type: annotation prefix: /admin idci_contact_form_admin_source: resource: "../../vendor/idci/contact-form-bundle/IDCI/Bundle/ContactFormBundle/Controller/AdminSourceController.php" type: annotation prefix: /admin idci_contact_form_admin_message: resource: "../../vendor/idci/contact-form-bundle/IDCI/Bundle/ContactFormBundle/Controller/AdminMessageController.php" type: annotation prefix: /admin
If you wish to see a form demo in action, you can add the contact demo controller
idci_contact_form_demo: resource: "../../vendor/idci/contact-form-bundle/IDCI/Bundle/ContactFormBundle/Controller/DemoController.php" type: annotation prefix: /contact-demo
Furthermore you can simply declare one route, which will include all controllers
idci_contact_form: resource: "../../vendor/idci/contact-form-bundle/IDCI/Bundle/ContactFormBundle/Controller" type: annotation prefix: /contact-form
Now the Bundle is installed.
Configure your database parameters in the app/config/parameters.yml then run
php app/console doctrine:schema:update --force
统计信息
- 总下载量: 1.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2013-03-18