2017-11-20 6 views
1

Doctrine Bundleに問題があります。私は、Webページへの侵入を試みるとき、私はエラーを持っている:Symfony - DoctrineBundleがアプリケーションに登録されていません

The DoctrineBundle is not registered in your application.

それはので設定におかしい/ bundles.php私が持っている:

return [ 
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], 
    FOS\RestBundle\FOSRestBundle::class => ['all' => true], 
    JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], 
    Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], 
    Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], 
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], 
]; 

アプリケーションのためのドクトリンバンドルavalible追加する方法は?または、おそらく教義/オルームとは何か? ありがとうございました。

EDIT

私は、コントローラで$これをダンプすると、services.kernel.bundlesに私が持っている:

["DoctrineBundle"]=> 
      object(Doctrine\Bundle\DoctrineBundle\DoctrineBundle)#73 (6) { 
      ["autoloader":"Doctrine\Bundle\DoctrineBundle\DoctrineBundle":private]=> 
      NULL 
      ["name":protected]=> 
      string(14) "DoctrineBundle" 
      ["extension":protected]=> 
      NULL 
      ["path":protected]=> 
      NULL 
      ["namespace":"Symfony\Component\HttpKernel\Bundle\Bundle":private]=> 
      string(30) "Doctrine\Bundle\DoctrineBundle" 
      ["container":protected]=> 
      *RECURSION* 
      } 
     } 
+0

キャッシュをクリアしましたか? '' 'php bin/console cache:clear --no-warmup --env = prod''' –

+0

はい、キャッシュはクリアです –

+0

@PiotrŻęgotaこれを解決しましたか?私はstandar 3.4のインストールでこれも遭遇します – ihsan

答えて

0

はこれを試してみてください。 app/AppKernel.phpファイルにその行を追加します。

new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),

ファイルはそれのように見えます。

class AppKernel extends Kernel 
{ 
    public function registerBundles() 
    { 
     $bundles = array(
      new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), 
      new Symfony\Bundle\SecurityBundle\SecurityBundle(), 
      new Symfony\Bundle\TwigBundle\TwigBundle(), 
      new Symfony\Bundle\MonologBundle\MonologBundle(), 
      new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), 
      new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 
      new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), 
      new DashboardBundle\DashboardBundle(), 
      new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), 
     ); 

     if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { 
      $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 
      $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 
      $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 
      $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
     } 

     return $bundles; 
    } 

    public function registerContainerConfiguration(LoaderInterface $loader) 
    { 
     $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); 
    } 
} 
+0

私はそれをやろうとしますが、それは結果を与えませんが、ベースポストを見てください。 –

関連する問題