public function CKEditor5OffCanvasTestController::testOffCanvas in Drupal 10
Returns a link that can open a node add form in an off-canvas dialog.
Return value
array A render array.
1 string reference to 'CKEditor5OffCanvasTestController::testOffCanvas'
- ckeditor5_test.routing.yml in core/
modules/ ckeditor5/ tests/ modules/ ckeditor5_test/ ckeditor5_test.routing.yml - core/modules/ckeditor5/tests/modules/ckeditor5_test/ckeditor5_test.routing.yml
File
- core/
modules/ ckeditor5/ tests/ modules/ ckeditor5_test/ src/ Controller/ CKEditor5OffCanvasTestController.php, line 20
Class
- CKEditor5OffCanvasTestController
- Provides controller for testing CKEditor in off-canvas dialogs.
Namespace
Drupal\ckeditor5_test\ControllerCode
public function testOffCanvas() {
$build['link'] = [
'#type' => 'link',
'#title' => 'Add Node',
'#url' => Url::fromRoute('node.add', [
'node_type' => 'page',
]),
'#attributes' => [
'class' => [
'use-ajax',
],
'data-dialog-type' => 'dialog',
'data-dialog-renderer' => 'off_canvas',
],
];
$build['#attached']['library'][] = 'core/drupal.dialog.off_canvas';
return $build;
}