我在Symfony上使用Ckeditor包,我正在尝试设置表单字段的字符限制,并显示剩余的字符计数器。
我找到了有关“maxLength”,“maxChar”,“maxWord”等道具的信息,但它不起作用:
$builder->add('description', CKEditorType::class, [
'config' => array(
'uiColor' => '#ffffff',
'toolbar' => [ [ "Image", "-", "Styles", "Format", "-", "Bold", "Italic", "Underline", "-", "Maximize" ] ],
'maxChar' => 2,
'showCharCount' => true
),
]);
在官方的Ckeditor文档中提到了special plugin这个,但我不知道,如果它适用于Symfony。有人知道,如何设置它?
为你的答案提供帮助。