配置Sonata管理包期间出错

时间:2015-09-06 15:47:17

标签: php symfony sonata-admin

我正在尝试配置Sonata Admin Bundle但我有这条错误消息:

Admin.yml中不存在文件“Admin.yml”(位于:C:\ xampp \ htdocs \ Symfony \ app / config,C:\ xampp \ htdocs \ Symfony \ app / Resources)(从“C:\ xampp \ htdocs \ Symfony \ app / config / routing_dev.yml”导入。

我按照文档中的所有说明进行操作。 有人知道错误来自何处?

谢谢

Config.yml

   imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }
    - { resource: @AdminAdminBundle/Resources/config/Admin.yml }

#sonata admin
sonata_block:
    default_contexts: [cms]
    blocks:
        # Enable the SonataAdminBundle block
        sonata.admin.block.admin_list:
            contexts:   [admin]

routing_dev.yml

   _wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

_configurator:
    resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
    prefix:   /_configurator

_errors:
    resource: "@TwigBundle/Resources/config/routing/errors.xml"
    prefix:   /_error

_main:
    resource: Admin.yml

# AcmeDemoBundle routes (to be removed)

的routing.yml

fly_user:
    resource: "@FLYUserBundle/Resources/config/Admin.yml"
    prefix:   /

FLY_Platform:
    resource: "@FLYPlatformBundle/Resources/config/Admin.yml"
    prefix:   /

mremi_contact_form:
    resource: "@MremiContactBundle/Resources/config/routing.xml"

genemu_base64:
        resource: "@GenemuFormBundle/Resources/config/routing/base64.xml"

fos_user_security:
    resource: "@FOSUserBundle/Resources/config/routing/security.xml"

fos_user_profile:
    resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
    prefix: /profile

fos_user_register:
    resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
    prefix: /register

fos_user_resetting:
    resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
    prefix: /resetting

fos_user_change_password:
    resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
    prefix: /profile

#HWIOAuthBundle routes
hwi_oauth_security:
    resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
    prefix: /login

hwi_oauth_connect:
    resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
    prefix: /login

hwi_oauth_redirect:
    resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
    prefix:   /login

facebook_login:
    pattern: /login/check-facebook


admin:
    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
    prefix: /admin

_sonata_admin:
    resource: .
    type: sonata_admin
    prefix: /admin

AdminAdminExtension.php

<?php

namespace Admin\AdminBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class AdminAdminExtension extends Extension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
        $loader->load('Admin.yml');
    }
}

0 个答案:

没有答案