In Drupal, PSR-4 namespaces are commonly used for organizing and autoloading custom PHP classes, including controllers. Here's how you can define a PSR-4 namespace for your custom module in Drupal:
Step 1: Module Structure
Ensure your module follows the standard Drupal module structure. Your module folder should be located in the modules/custom directory of your Drupal installation. For example, if your module is named "custom_hello", the folder structure would look like this: