- Drupal 8 Module Development
- Daniel Sipos
- 133字
- 2021-07-02 15:45:14
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 is 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.
- PHP+MySQL網站開發技術項目式教程(第2版)
- C語言程序設計實訓教程
- C語言程序設計
- Python數據可視化之Matplotlib與Pyecharts實戰
- RabbitMQ Cookbook
- Learning ArcGIS for Desktop
- 移動界面(Web/App)Photoshop UI設計十全大補
- 基于Struts、Hibernate、Spring架構的Web應用開發
- Julia高性能科學計算(第2版)
- Learning Node.js for .NET Developers
- .NET 4.0面向對象編程漫談:應用篇
- Java高手是怎樣煉成的:原理、方法與實踐
- 計算機組裝與維護(第二版)
- ROS機器人編程實戰
- Arduino Electronics Blueprints