sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Symfony MenuBundle installation on src/Knplabs/Bundle/MenuBundle causes errors #103

Closed plaginha closed 13 years ago

plaginha commented 13 years ago

As recommended, a MenuBunble installation, as base to Admin Bundle installation, in the directory src/Knplabs/Bundle/MenuBundle causes errors.

The first one I noted is on app/console command that finish execution with an error: "[Exception] The autoloader expected class "Knplabs\Bundle\MenuBundle\KnplabsMenuBundle" to be defined in file "/app/../src/Knplabs/Bundle/MenuBundle/KnplabsMenuBundle.php". You probably have a typo in the namespace or the class name."

( is my project root directory) Then, if you made all configurations recommended, the bundle does not work.

I verify that:

  1. Installing Menu Bundle in src/Knplabs/MenuBundle
  2. Changing the line app/AppKernel.php wich loads it from "new Knplabs\Bundle\MenuBundle\KnplabsMenuBundle()," to "new Knplabs\MenuBundle\KnplabsMenuBundle(),"
  3. Changing the lines (31 and 32) of src/Sonata/AdminBundle/Admin/Admin.php from use Knplabs\Bundle\MenuBundle\Menu; use Knplabs\Bundle\MenuBundle\MenuItem; to use Knplabs\MenuBundle\Menu; use Knplabs\MenuBundle\MenuItem; make AdminBundle start to work.

I suggest that you make change 3. on AdminBundle code.

stof commented 13 years ago

Use an uptodate version of the MenuBundle. It is definetely in the Knplabs\Bundle\MenuBundle namespace: https://github.com/knplabs/MenuBundle