在Symfony2中配置Propel ORM时出错

时间:2015-01-23 16:50:20

标签: php symfony orm propel

我试图在Symfony2项目中配置推进ORM,但是当我运行symfony命令lin工具时,我不断收到此错误消息:

[Symfony\Component\Config\Exception\FileLoaderLoadException]
  There is no extension able to load the configuration for "propel" (in C:\Program Files (x86)\Zend\Apache2\htdocs\se\app/config\config.yml). Looked for namespace "propel", found "
  framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "acme_demo", "debug", "web_profiler", "sensio_distribution" in C:\Progr
  am Files (x86)\Zend\Apache2\htdocs\se\app/config\config.yml (which is being imported from "C:\Program Files (x86)\Zend\Apache2\htdocs\se\app/config/config_dev.yml").

我根据官方文档配置:

#Propel Configuration
propel:
    dbal:
        driver:     "%database_driver%"
        user:       "%database_user%"
        password:   "%database_password%"
        dsn:        "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"

我通过作曲家正确安装了推进包。 propel命令行工作正常。

1 个答案:

答案 0 :(得分:1)

您是否已将PropelBundle添加到AppKernel?看起来你没有。

AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Propel\PropelBundle\PropelBundle(),
    );

    // ...
}

http://propelorm.org/Propel/cookbook/symfony2/working-with-symfony2.html