baconmanager / core-bundle

这是symfony2的包

安装次数: 1,164

依赖者: 1

建议者: 0

安全: 0

星标: 0

关注者: 4

分支: 1

开放问题: 2

类型:symfony-bundle

1.1.4 2017-02-21 17:18 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:36:55 UTC


README

Codacy Badge Latest Stable Version License SensioLabsInsight

此包负责添加类以抽象化一些Symfony函数,例如具有行为的基础实体以创建<强>创建/更新和<强>软删除标准字段,以及基于ORM Doctrine2的数据库记录保存、更新和删除的基础表单处理器。

安装

要安装此包,只需运行以下命令:

$ composer require bacon/core-bundle

现在请将以下包添加到AppKernel.php文件中

<?php
// app/AppKernel.php
public function registerBundles()
{
    // ...
    new Bacon\Bundle\CoreBundle\BaconCoreBundle(),
    new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
    // ...
}

在文件<强>app/config/config.yml中添加以下配置

doctrine:
	---
    orm:
        filters:
            softdeleteable:
                class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                enabled: true

在文件<强>app/config/services.yml的services部分添加以下行

services:
    gedmo.listener.softdeleteable:
        class: Gedmo\SoftDeleteable\SoftDeleteableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ @annotation_reader ] ]

    gedmo.listener.timestampable:
        class: Gedmo\Timestampable\TimestampableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ "@annotation_reader" ] ]

要配置KnpPaginatorBundle包,请查看包的配置,可通过访问此链接

附加信息