現在、Drupal 8 用のカスタム モジュールを開発しています。バックエンド フォームを追加してユーザーからデータを取得しているときに、テキストエリアを置き換えるように ckeditor を構成しようとしましたが、失敗しました >.<
フォーム定義は次のとおりです。
$form['text'] = array(
'#type' => 'textarea',
'#title' => t('Text'),
'#required' => TRUE,
'#attributes' => array(
'id' => 'text',
'style' => 'max-width: 650px'
),
'#default_value' => $data['text']
);
テキストエリアを置き換えるには、ckeditor をどこにロードする必要がありますか?
私がすでに試したこと:
$build['#attached'] = array(
'js' => array(
drupal_get_path('module', 'ckeditor') . '/js/ckeditor.js'
drupal_render($build);
と
drupal_load_library("ckeditor", "ckeditor");
しかし、すべての依存関係をロードすることはできません