By editor, 29 March, 2017 Question How to Check module exist ? How to Get module / Theme install directory ? How to Get a file in a custom module Check module exist if (\Drupal::moduleHandler()->moduleExists('my_module')) { $message = 'Module exist.'; } else { $message = 'Not exists.'; } Get module / Theme install directory $path = drupal_get_path('module', 'my_module'); Get a file in a custom module $path = drupal_get_path('module', 'my_module') . '/my_module.info.yml'; Tags Drupal 8 Code Module Create a simple module for Drupal 8 - Step 1 Create a simple module for Drupal 8 - Step 2 - Create Simple Page Create a simple module for Drupal 8 - Step 3 - Create Dynamic Page/ Block Create a field in a node entity programmatically on Drupal 8. Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments