简体   繁体   中英

SonataAdminBundle with Symfony ~2.4 - how to install?

I just set up a new Symfony 2.4 project and try to install the SonataAdminBundle ( instruction ), but I get errors again.

History :

# install symfony (demo works!)
composer create-project symfony/framework-standard-edition ./ 2.4.*

# install admin bundle (instruction above)
composer require sonata-project/admin-bundle
-> version: dev-master

# install DoctrineORMAdminBundle (FAILS!)
composer require sonata-project/doctrine-orm-admin-bundle
-> version: dev-master

Well, I failed on step 1.2 , error :

Please provide a version constraint for the sonata-project/doctrine-orm-admin-bundle requirement: dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
Updating the "app/config/parameters.yml" file

  [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
  The service "sonata.admin.builder.orm_datagrid" has a dependency on a non-existent service "sonata.admin.builder.filter.factory".

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

  [RuntimeException]
  An error occurred when executing the ""cache:clear --no-warmup"" command.

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [packages1] ... [packagesN]

Interesting line:

The service "sonata.admin.builder.orm_datagrid" has a dependency on a non-existent service "sonata.admin.builder.filter.factory".

Does anyone know what to do? Thanks a lot in advance!

You have to register both the SonataAdminBundle and SonataDoctrineOrmAdminBundle. It looks like you forgot to activate SonataAdminBundle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM