定制 thewellcom/contact-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thewellcom/contact-bundle

Composer 安装命令:

composer require thewellcom/contact-bundle

包简介

Make a contact form easily with this bundle

README 文档

README

Configuration:

In app/AppKernel.php

class AppKernel extends Kernel
{
    ...

    public function registerBundles()
    {
        ...
        new TheWellCom\ContactBundle\TheWellComContactBundle(),
        ...
    }
}

You need to create your own ContactBundle.

And in YourProjectContactBundle.php:

namespace YourProject\Bundle\ContactBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class YourProjectContactBundle extends Bundle
{
    public function getParent()
    {
        return 'TheWellComContactBundle';
    }
}

Create the entity Contact:

And in YourProject\Bundle\ContactBundle\Entity\Contact.php:

<?php

namespace TM\Bundle\ContactBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use TheWellCom\ContactBundle\Model\Contact as BaseContact;

/**
 * Contact.
 *
 * @ORM\Table(name="contact")
 * @ORM\Entity
 */
class Contact extends BaseContact
{
    ...
}

In app/config/config.yml:

the_well_com_contact:
    mail_to: 'xy@domainname.com'
    site_name: 'Your site name'
    entity_class: 'YourProject\Bundle\ContactBundle\Entity\Contact'

In app/config/routing.yml

the_well_com_contact:
    resource: "@TheWellComContactBundle/Resources/config/routing.yml"

Admin with sonataAdminBundle:

You need to install sonataAdminBundle: https://github.com/sonata-project/SonataAdminBundle

ContactAdmin.php

If you need to add an admin manager, you just have to add in your ContactAdmin.php:

namespace YourProject\Bundle\ContactBundle\Admin;

use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use TheWellCom\ContactBundle\Admin\ContactAdmin as BaseAdmin;

class ContactAdmin extends BaseAdmin
{
    ...
}

service.yml

In your service.yml file add:

services:
    admin.contact:
        class: YourProject\Bundle\ContactBundle\Admin\ContactAdmin
        arguments: [~, YourProject\Bundle\ContactBundle\Entity\Contact, ~]
        tags:
            - { name: sonata.admin, manager_type: orm, label: Contact }

统计信息

  • 总下载量: 65
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固