X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fdialog_renderer_test%2Fsrc%2FController%2FTestController.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fdialog_renderer_test%2Fsrc%2FController%2FTestController.php;h=853c620dc23c83488144d17cd93ae7d9e2a63444;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/system/tests/modules/dialog_renderer_test/src/Controller/TestController.php b/web/core/modules/system/tests/modules/dialog_renderer_test/src/Controller/TestController.php new file mode 100644 index 000000000..853c620dc --- /dev/null +++ b/web/core/modules/system/tests/modules/dialog_renderer_test/src/Controller/TestController.php @@ -0,0 +1,80 @@ + 'markup', + '#markup' => 'Look at me in a modal!', + ]; + } + + /** + * Displays test links that will open in the modal dialog. + * + * @return array + * Render array with links. + */ + public function linksDisplay() { + return [ + 'normal_modal' => [ + '#title' => 'Normal Modal!', + '#type' => 'link', + '#url' => Url::fromRoute('dialog_renderer_test.modal_content'), + '#attributes' => [ + 'class' => ['use-ajax'], + 'data-dialog-type' => 'modal', + ], + '#attached' => [ + 'library' => [ + 'core/drupal.ajax', + ], + ], + ], + 'wide_modal' => [ + '#title' => 'Wide Modal!', + '#type' => 'link', + '#url' => Url::fromRoute('dialog_renderer_test.modal_content'), + '#attributes' => [ + 'class' => ['use-ajax'], + 'data-dialog-type' => 'modal', + 'data-dialog-renderer' => 'wide', + ], + '#attached' => [ + 'library' => [ + 'core/drupal.ajax', + ], + ], + ], + 'extra_wide_modal' => [ + '#title' => 'Extra Wide Modal!', + '#type' => 'link', + '#url' => Url::fromRoute('dialog_renderer_test.modal_content'), + '#attributes' => [ + 'class' => ['use-ajax'], + 'data-dialog-type' => 'modal', + 'data-dialog-renderer' => 'extra_wide', + ], + '#attached' => [ + 'library' => [ + 'core/drupal.ajax', + ], + ], + ], + ]; + } + +}