- 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.
- 新編Visual Basic程序設(shè)計(jì)上機(jī)實(shí)驗(yàn)教程
- Photoshop智能手機(jī)APP UI設(shè)計(jì)之道
- 軟件測(cè)試項(xiàng)目實(shí)戰(zhàn)之性能測(cè)試篇
- Python程序設(shè)計(jì)案例教程
- Kinect for Windows SDK Programming Guide
- Asynchronous Android Programming(Second Edition)
- Windows Phone 7.5:Building Location-aware Applications
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- Mastering C++ Multithreading
- Practical Game Design with Unity and Playmaker
- 軟件項(xiàng)目管理實(shí)用教程
- Learning Modular Java Programming
- Learning AWS
- SQL Server 2008中文版項(xiàng)目教程(第3版)
- Mastering VMware vSphere Storage