- Drupal 8 Module Development
- Daniel Sipos
- 135字
- 2021-07-02 12:22:38
Namespaces
Before moving on with the Controller we set out to write, let's break down the namespace situation in Drupal 8 and how the folder structure needs to be inside a module.
Drupal 8 uses the PSR-4 namespace autoloading standard. In effect, this means that the namespace of all Drupal core and module classes starts with \Drupal. For modules, the base namespace is \Drupal\module_name, where module_name is the machine name of the module. This then maps to the /src folder found inside the module directory (for main integration files). For PHPUnit tests, we have a different namespace, as we will see later in the book.
So essentially, we will need a /src folder inside our module to place all of our classes that need to be autoloaded. So, we can go ahead and create it.
- The Complete Rust Programming Reference Guide
- TestNG Beginner's Guide
- 跟小海龜學Python
- Web Application Development with R Using Shiny(Second Edition)
- 程序員考試案例梳理、真題透解與強化訓練
- 精通Scrapy網絡爬蟲
- Getting Started with LLVM Core Libraries
- C++從入門到精通(第5版)
- 第一行代碼 C語言(視頻講解版)
- C語言程序設計
- Swift 4從零到精通iOS開發
- Drupal 8 Development:Beginner's Guide(Second Edition)
- ASP.NET Core and Angular 2
- Mastering ArcGIS Server Development with JavaScript
- C語言王者歸來