Search code examples
phpsymfonysonata-adminsymfony-sonatasonata

Could not load type "sonata_simple_formatter_type"


I'm using Symfony framework and SonataBundle to build the admin application.

When I'm trying to setup a field with type blob and using the "sonata_simple_formatter_type" of SonataFormatterBundle, i was got the error:

Could not load type "sonata_simple_formatter_type"

Here is my composer.json file:

    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    //*...*/
    "sonata-project/admin-bundle": "2.3.10",
    "sonata-project/doctrine-orm-admin-bundle": "2.3.3",
    "sonata-project/user-bundle": "2.2.4",
    "sonata-project/formatter-bundle": "2.3.3",

I was prefer to this link to making the admin app: sonata formatter


Solution

  • To fix the error, you also need to configure SonataFormatterBundle: https://sonata-project.org/bundles/formatter/master/doc/reference/installation.html

    For the SonataAdminBundle you also need to do some extra configuration: https://sonata-project.org/bundles/formatter/master/doc/reference/formatter_widget.html#sonata-admin-integration