简体   繁体   中英

Symfony, Sonata Admin

I try to install Sonata Admin with my Symfony. I follow the instruction of the link http://sonata-project.org/bundles/admin/master/doc/reference/getting_started.html .

I choose file format is admin.yml. When I run php app/console assets:install

I got the error 在此处输入图片说明

Here are my admin.yml

Acme/DemoBundle/Resources/config/admin.yml

在此处输入图片说明

In your extension file DemoBundle\\DependencyInjection\\DemobundleExtension (or whatever you named it), you should load the configuration file with Loader\\YamlFileLoader, you are probably doing it with Loader\\XmlFileLoader

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

Thanks,

I change it to admin.xml and it works. Thanks for your help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM