官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 武邑县| 无极县| 九江市| 喀喇| 阜平县| 铜鼓县| 红安县| 三亚市| 汪清县| 紫云| 广丰县| 东兰县| 郎溪县| 长沙县| 海晏县| 洛南县| 道真| 大名县| 屯门区| 兴业县| 卫辉市| 潢川县| 磐安县| 通城县| 三门峡市| 钟祥市| 白山市| 苍南县| 三江| 麟游县| 清新县| 闸北区| 买车| 广南县| 嵊州市| 衡山县| 贡嘎县| 大安市| 建始县| 且末县| 绩溪县|