你以错误的方式看待它。
您必须在此处使用选项。
创建表单:
$form = $this->createForm(new AnamneseType(), null, array('history' => $entity->getHistory()));
您的表格应如下所示:
public function buildForm(FormBuilder $builder, array $options){
$toolbar = array(
array(
'name' => 'document',
'items' => array('Source','-','DocProps','Preview','Print','-','Templates')
),
array(
'name' => 'clipboard',
'items' => array('Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo')
),
array(
'name' => 'editing',
'items' => array('Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt')
),
array(
'name' => 'basicstyles',
'items' => array('Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat')
),
'/',
array(
'name' => 'paragraph',
'items' => array('NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl')
),
array(
'name' => 'links',
'items' => array('Link','Unlink','Anchor')
),
array(
'name' => 'insert',
'items' => array('Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak')
),
'/',
array(
'name' => 'styles',
'items' => array('Styles','Format','Font','FontSize')
),
array(
'name' => 'colors',
'items' => array('TextColor','BGColor')
),
array(
'name' => 'tools',
'items' => array('Maximize', 'ShowBlocks','-','About')
)
);
$builder->add('history', 'ckeditor', array( 'data' => $options['history'] , 'toolbar' => $toolbar));
}
...
public function getDefaultOptions(array $options)
{
return array(
'history' => "Digite o Historico aqui"
);
}