- Drupal 8 Module Development
- Daniel Sipos
- 124字
- 2021-07-02 15:45:21
Tokens
The last thing we will cover in this chapter is the Token API in Drupal 8. We will cover a few theories and, as usual, demonstrate them via examples on our existing "Hello World" module code. We will do this in the context of the mails we are sending out for error logs.
It would be nice if we could include some personalized information in the mail text without having to hardcode it in the module code or configuration. For example, in our case, we might want to include in the email the username of the current user that is triggering the error log that is being emailed.
Let's first understand how the Token API works, before going into our "Hello World" module.
推薦閱讀
- Unity 2020 Mobile Game Development
- Dependency Injection in .NET Core 2.0
- 網頁設計與制作教程(HTML+CSS+JavaScript)(第2版)
- 新編Premiere Pro CC從入門到精通
- Python機器學習經典實例
- 青少年Python編程入門
- Instant Nancy Web Development
- 深度學習:Java語言實現
- C語言程序設計
- Visual Studio Code 權威指南
- PHP+MySQL動態網站開發從入門到精通(視頻教學版)
- 30天學通C#項目案例開發
- Python Social Media Analytics
- JavaEE架構與程序設計
- Android應用開發攻略