首页 文章

在Symfony 3.2.3项目上安装SonataAdminBundle

提问于
浏览
0

我想在symfony 3.2.3项目上安装sonataAdminBundle,我是文档:http://symfony.com/doc/master/bundles/SonataAdminBundle/reference/installation.html在项目2.3.1中我创建了AppExtension类:

<?php
// src/AppBundle/DependencyInjection/AppExtension.php

namespace AppBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\Config\FileLocator;

class AppExtension extends Extension 
{
    public function load(array $configs, ContainerBuilder $container)
    {
        // ...
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        // ...
        $loader->load('admin.yml');
    }
}

我按照2.3.2中的描述修改了config.yml文件 . 当在2.4点我做了资产:install或caache:clear,我有以下错误:

致命错误:在第9行的T:\ Wampsites \ CoursSymfony \ sonataBundle \ src \ AppBundle \ DependencyInjection \ AppExtension.php中找不到类'AppBundle \ DependencyInjection \ Extension'

它没有找到Extension类 . 它必须错过一个用途,但我不知道哪一个 . 我尝试过:

use Symfony\Component\DependencyInjection\Extension\Extension;

但是我有以下错误:

AppBundle声明\ DependencyInjection \ AppExtension :: load(数组$ configs,AppBundle \ DependencyInjection \ ContainerBuilder $ container)必须与Symfony \ Component \ DependencyInjection \ Extension \ ExtensionInterface :: load兼容(数组$ configs,Symfony \ Component \ DependencyInjection) \ ContainerBuilder $ container)在......

谢谢你帮我解决这个问题 .

亲切

1 回答

相关问题