Search code examples
phpsymfonysymfony-sonata

Install SonataNewsBundle


I learn Symfony 2. I would like have example with SonataAdminBundle. I found:

http://sonata-project.org/bundles/news/2-0/doc/reference/installation.html

but this haven't first point. i found:

[SonataAdminBundle]
    git=http://github.com/sonata-project/SonataAdminBundle.git
    target=/bundles/Sonata/AdminBundle

[SonataBlockBundle]
    git=http://github.com/sonata-project/SonataBlockBundle.git
    target=/bundles/Sonata/BlockBundle

[SonataCacheBundle]
    git=http://github.com/sonata-project/SonataCacheBundle.git
    target=/bundles/Sonata/CacheBundle

[SonatajQueryBundle]
    git=http://github.com/sonata-project/SonatajQueryBundle.git
    target=/bundles/Sonata/jQueryBundle

[SonataDoctrineORMAdminBundle]
    git=http://github.com/sonata-project/SonataDoctrineORMAdminBundle.git
    target=/bundles/Sonata/DoctrineORMAdminBundle

[KnpMenuBundle]
    git=http://github.com/KnpLabs/KnpMenuBundle.git
    target=/bundles/Knp/Bundle/MenuBundle

[KnpMenu]
    git=http://github.com/KnpLabs/KnpMenu.git
    target=/knp/menu

[Exporter]
    git=http://github.com/sonata-project/exporter.git
    target=/exporter

[SonataNewsBundle]
    git=http://github.com/sonata-project/SonataNewsBundle.git
    target=/bundles/Sonata/NewsBundle

and run bin/install vendors. . Install is correct. Id added line to AppKernel and autoload, and if i run:

php app/console sonata:easy-extends:generate SonataNewsBundle

i have error:

[InvalidArgumentException]
Bundle "ApplicationSonataNewsBundle" does not exist or it is not enabled.

So i added:

new Application\Sonata\NewsBundle\ApplicationSonataNewsBundle(),

and run

php app/console sonata:easy-extends:generate SonataNewsBundle

then i have error:

PHP Fatal error: Class 'Application\Sonata\NewsBundle\ApplicationSonataNewsBundle' not found in /home/lanox06/Projects/sym2/app/AppKernel.php on line 29

How can i make this? I would like testing these application.


Solution

  • You should move the ./app/Application folder from ./app to the ./src directory.