【发布时间】:2015-02-21 13:56:34
【问题描述】:
我目前正在为 Drupal 8 开发一个自定义模块。 在添加后端表单以从用户那里获取一些数据时,我尝试将 ckeditor 配置为替换我的 textareas ......但失败了 >.
这是表单定义:
$form['text'] = array(
'#type' => 'textarea',
'#title' => t('Text'),
'#required' => TRUE,
'#attributes' => array(
'id' => 'text',
'style' => 'max-width: 650px'
),
'#default_value' => $data['text']
);
我需要在哪里加载 ckeditor 来替换我的 textarea?
我已经尝试过的事情:
$build['#attached'] = array(
'js' => array(
drupal_get_path('module', 'ckeditor') . '/js/ckeditor.js'
drupal_render($build);
和
drupal_load_library("ckeditor", "ckeditor");
但我无法加载所有依赖项
【问题讨论】: