In a Drupal eight undertaking I’ve a controller which returns a kind that accommodates a text_format subject.
CKeditor is working completely in my administration theme (Steady), however it doesn’t on the default theme.
I’ve tried to connect ckeditor core module libraries to the controller returned response with no outcomes.
The function which I check with has permissions “Use easy HTML textual content format”, “Use full HTML textual content format”, additionally the function is checked on /admin/config/content material/codecs/handle/basic_html
additionally on /admin/config/content material/codecs/handle/full_html
.
my_module/src/Controller/MyController.php :
<?php
namespace Drupalmy_moduleController;
use DrupalCoreControllerControllerBase;
use DrupaluserEntityUser;
/**
* Present consumer kind.
*/
class MyController extends ControllerBase {
/**
* Return web page content material.
*/
public operate content material() {
// Load consumer edit kind.
$entity = Consumer::load(Drupal::currentUser()->id());
$formObject = Drupal::entityTypeManager()
->getFormObject('consumer', 'default')
->setEntity($entity);
$kind = Drupal::formBuilder()->getForm($formObject);
$render = Drupal::service('renderer');
$render_form = $render->renderPlain($kind);
return [
'#theme' => 'customize_user_form',
'#form' => $render_form,
'#attached' => [
// Attach ckeditor core module libraries.
'library' => [
'ckeditor/drupal.ckeditor',
'ckeditor/drupal.ckeditor.stylescombo.admin',
'ckeditor/drupal.ckeditor.admin',
'ckeditor/drupal.ckeditor.plugins.drupalimagecaption',
],
],
];
}
}
Outcomes:
Any solutions?
Many thanks.