- Drupal 8 Module Development
- Daniel Sipos
- 140字
- 2021-07-02 12:22:39
Invoked Controllers
Now that we know what routes, Controllers and services are, I'd also like to quickly note that Controllers can be defined as services and invoked by the routing system. In other words, just as we defined our hello_world.salutation service, we could define another one that would act as a Controller and reference that service ID in the routing file instead of the fully qualified class name. Then, in order for Drupal to know which method inside the service to call when a user accesses the route, we would need to implement the magic __invoke method inside the service. And the rest would work pretty much in the same way.
This capability was introduced in Drupal 8.7 and is typical to the Action-Domain-Responder architectural pattern. We won't use it going forward but it's good to know that it's available.
- Go Web編程
- Oracle從入門到精通(第3版)
- SQL Server 從入門到項目實踐(超值版)
- Software Testing using Visual Studio 2012
- 營銷數據科學:用R和Python進行預測分析的建模技術
- 響應式架構:消息模式Actor實現與Scala、Akka應用集成
- 深度實踐KVM:核心技術、管理運維、性能優化與項目實施
- 寫給青少年的人工智能(Python版·微課視頻版)
- 分布式數據庫HBase案例教程
- Puppet 5 Beginner's Guide(Third Edition)
- Instant Pygame for Python Game Development How-to
- 可視化H5頁面設計與制作:Mugeda標準教程
- Implementing NetScaler VPX?(Second Edition)
- Mastering Chef Provisioning
- Python深度學習實戰:基于TensorFlow和Keras的聊天機器人以及人臉、物體和語音識別