Resolve #3441930 "Create a demo"
3 unresolved threads
3 unresolved threads
Closes #3441930
Merge request reports
Activity
added 1 commit
- 46e74ef3 - Moved the module from themes to module folder
- modules/demo_jsx/demo_jsx.module 0 → 100644
1 <?php 2 3 use Drupal\Core\Extension\Extension; 4 5 /** 6 * Implements hook_system_info_alter(). 7 */ 8 function demo_jsx_info_alter(array &$info, Extension $file, $type): void { 9 $info['engine'] = 'jsx'; changed this line in version 5 of the diff
- modules/demo_jsx/demo_jsx.module 0 → 100644
1 <?php 2 3 /** 4 * Implements hook_theme_suggestions_HOOK_alter() to conditionally suggest JSX templates. 5 */ 6 function demo_jsx_theme_suggestions_block_alter(array &$suggestions, array $variables) { 7 $current_path = \Drupal::service('path.current')->getPath(); 8 $temp=[] ; 9 10 foreach ($suggestions as $suggestion) { 11 if($suggestion == 'block__search_form_block'){ 1 <?php 2 3 namespace Drupal\demo_jsx\Controller; 4 5 use Drupal\Core\Controller\ControllerBase; 6 7 class ReactComponentController extends ControllerBase { 8 9 public function renderReactUI() { 10 // Attach the necessary library for React component. 11 $build['#attached']['library'][] = 'demo_jsx/demo_jsx.react';
Please register or sign in to reply