FullCalendarBundle 处理 symfony 3.4 中的事件错误
FullCalendarBundle handle event error in symfony 3.4
我安装了 fullcalendarbundle,并按照 Github 中提到的进行了配置
https://github.com/tattali/CalendarBundle/blob/master/src/Resources/doc/doctrine-crud.md#3-create-the-crud,我可以显示日历。但是当我尝试创建日历事件时。我有错误
The "AppBundle\Repository\CalendarEventsRepository" entity repository implements "Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface", but its service could not be found. Make sure the service exists and is tagged with "doctrine.repository_service".
这是我的存储库
<?php
namespace AppBundle\Repository;
use AppBundle\Entity\CalendarEvents;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
class CalendarEventsRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, CalendarEvents::class);
}
}
我的services.yml配置是这样的。
parameters:
services:
#default configuration for services in *this* file
_defaults:
autowire: true
autoconfigure: true
public: false
AppBundle\:
resource: '../../src/AppBundle/*'
exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']
# AppBundle\Service\ExampleService:
# arguments:
# $someArgument: 'some_value'
# AppBundle\Twig\PlanningExtension:
# tags: ['twig.extension']
# adding the required tag to all repository services
#AppBundle\Repository\CalendarEventsRepository:
# arguments:
# - '@doctrine.orm.entity_manager'
# - '@=service("doctrine.orm.entity_manager").getClassMetadata("AppBundle\Entity\CalendarEvents")'
# tags:
# - { name: doctrine.repository_service }
我正在使用 symfony 3.4。我找了几个解决方案都没有成功,如果你有解决方案的话。我很高兴你能帮助我。
如果要自动装配存储库,请修改排除设置:
AppBundle\:
resource: '../../src/AppBundle/*'
exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
...定义:自动装配 src/AppBundle
中的所有内容,子文件夹 Entity
、Repository
和 Tests
中的那些 类 除外。通过从该列表中删除 Repository
,您允许自动装配您的存储库
我安装了 fullcalendarbundle,并按照 Github 中提到的进行了配置 https://github.com/tattali/CalendarBundle/blob/master/src/Resources/doc/doctrine-crud.md#3-create-the-crud,我可以显示日历。但是当我尝试创建日历事件时。我有错误
The "AppBundle\Repository\CalendarEventsRepository" entity repository implements "Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface", but its service could not be found. Make sure the service exists and is tagged with "doctrine.repository_service".
这是我的存储库
<?php
namespace AppBundle\Repository;
use AppBundle\Entity\CalendarEvents;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
class CalendarEventsRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, CalendarEvents::class);
}
}
我的services.yml配置是这样的。
parameters:
services:
#default configuration for services in *this* file
_defaults:
autowire: true
autoconfigure: true
public: false
AppBundle\:
resource: '../../src/AppBundle/*'
exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']
# AppBundle\Service\ExampleService:
# arguments:
# $someArgument: 'some_value'
# AppBundle\Twig\PlanningExtension:
# tags: ['twig.extension']
# adding the required tag to all repository services
#AppBundle\Repository\CalendarEventsRepository:
# arguments:
# - '@doctrine.orm.entity_manager'
# - '@=service("doctrine.orm.entity_manager").getClassMetadata("AppBundle\Entity\CalendarEvents")'
# tags:
# - { name: doctrine.repository_service }
我正在使用 symfony 3.4。我找了几个解决方案都没有成功,如果你有解决方案的话。我很高兴你能帮助我。
如果要自动装配存储库,请修改排除设置:
AppBundle\:
resource: '../../src/AppBundle/*'
exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
...定义:自动装配 src/AppBundle
中的所有内容,子文件夹 Entity
、Repository
和 Tests
中的那些 类 除外。通过从该列表中删除 Repository
,您允许自动装配您的存储库