2015-01-06 2 views
0

SonataAdmin을 사용하여 SonataFormatter를 사용합니다. 텍스트 영역을 볼 수 있지만 도구 모음이 나타나지 않습니다.SonataFormatter ivory_ck_editor 도구 모음이 표시되지 않습니다.

런타임에 코드를 사용하여 툴바를 강제 실행할 수 있습니다. 내가 놓친 게 있니?

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, 
     )) 
    ; 
} 

답변

0

추가 할 :

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

안녕하세요, 내가 여기, 어디에 같은 문제가 그것을 추가 했습니까? – MauJFernandez

+1

내 config.yml 파일 – Sancho

+0

고마워요, 나뭇 가지 나무 아래에 실제로, 당신은 혼란을 피하기 위해 귀하의 게시물에 "양식"앞에 추가해야합니다. – MauJFernandez

관련 문제