SonataFormatter ivory_ck_editor 工具栏不显示

SonataFormatter ivory_ck_editor toolbar doesn't show up

我将 SonataFormatter 与 SonataAdmin 一起使用。我可以看到文本区域,但工具栏没有出现。

我可以使用下面的代码在运行时强制工具栏。我错过了什么吗?

CKEDITOR.replace( 'textbox id', {
toolbar: [
    { name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
    [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],          // Defines toolbar group without name.
    '/',                                                                                    // Line break - next group will be placed in new line.
    { name: 'basicstyles', items: [ 'Bold', 'Italic' ] }
]
});

我的config.yml

sonata_formatter:
    formatters:
        markdown:
            service: sonata.formatter.text.markdown
            extensions:
                - sonata.formatter.twig.control_flow
                - sonata.formatter.twig.gist


        text:
            service: sonata.formatter.text.text
            extensions:
                - sonata.formatter.twig.control_flow
                - sonata.formatter.twig.gist


        rawhtml:
            service: sonata.formatter.text.raw
            extensions:
                - sonata.formatter.twig.control_flow
                - sonata.formatter.twig.gist


        richhtml:
            service: sonata.formatter.text.raw
            extensions:
                - sonata.formatter.twig.control_flow
                - sonata.formatter.twig.gist

ivory_ck_editor:
    configs:
        default:
            language:  '%locale%'
            toolbar: standard

我的管理类:

protected function configureFormFields(FormMapper $formMapper)
{
     $formMapper
        ->add('content', 'sonata_formatter_type', array(
          'event_dispatcher' => $formMapper->getFormBuilder()->getEventDispatcher(),
          'format_field'   => 'contentFormatter',
          'source_field'   => 'rawContent',
          'source_field_options'      => array(
            'horizontal_input_wrapper_class' => $this->getConfigurationPool()->getOption('form_type') == 'horizontal' ? 'col-lg-12': '',
           'attr' => array('class' => $this->getConfigurationPool()->getOption('form_type') == 'horizontal' ? 'span10 col-sm-10 col-md-10': '', 'rows' => 20)
         ),
         'ckeditor_context'     => 'default',
         'target_field'   => 'content',
         'listener'       => true,
         ))
  ;
}

忘记补充了:

form:
    resources:
        - 'SonataFormatterBundle:Form:formatter.html.twig'