(没有扩展能够加载" sonata_block"

时间:2014-06-26 13:20:08

标签: git symfony

我在symfony 2.5中生成管理面板时发现此错误。 请问一下这是什么意思?因为我是symfony的新手,无法得到它。 使用GIT时出错,当清除缓存使用时,app / console cache:clear或者其他任何东西,浏览器中出现相同的错误。

  [Symfony\Component\Config\Exception\FileLoaderLoadException]
  Cannot import resource "D:\xampp\htdocs\myassignment\app/config\config.yml"
   from "D:\xampp\htdocs\myassignment\app/config/config_dev.yml". (There is n
  o extension able to load the configuration for "sonata_block" (in D:\xampp\
  htdocs\myassignment\app/config\config.yml). Looked for namespace "sonata_bl
  ock", found "framework", "security", "twig", "monolog", "swiftmailer", "ass
  etic", "doctrine", "sensio_framework_extra", "member", "sonata_admin", "son
  ata_doctrine_orm_admin", "acme_demo", "web_profiler", "sensio_distribution"
  )


  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
  There is no extension able to load the configuration for "sonata_block" (in
   D:\xampp\htdocs\myassignment\app/config\config.yml). Looked for namespace
  "sonata_block", found "framework", "security", "twig", "monolog", "swiftmai
  ler", "assetic", "doctrine", "sensio_framework_extra", "member", "sonata_ad
  min", "sonata_doctrine_orm_admin", "acme_demo", "web_profiler", "sensio_dis
  tribution"

这是我的代码

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: @memberBundle/Resources/config/admin.yml }

framework:
    #esi:             ~
    #translator:      { fallback: "%locale%" }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
    fragments:       ~
    http_method_override: true

# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        [ ]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:
        #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
        #yui_css:
        #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

# Doctrine Configuration
doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: "%kernel.root_dir%/data/data.db3"
        # path:     "%database_path%"

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }

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

这是我的内核

2 个答案:

答案 0 :(得分:0)

您应该在AppKernel.php中注册SonataBlockBundle

答案 1 :(得分:0)

官方文档指出要在AppKernel.php上初始化的包列表

document.getElementById("myForm").submit();

所以你忘了初始化SonataBlockBundle。 不要忘记为您的驱动程序安装和初始化正确的ORM / ODM。

此处有更多信息:https://sonata-project.org/bundles/admin/3-x/doc/getting_started/installation.html