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

Tokens

The last thing we will cover in this chapter is the Token API in Drupal 8. We will cover a few bits of theory 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.

主站蜘蛛池模板: 岗巴县| 阜南县| 乐安县| 贵阳市| 内江市| 修武县| 虹口区| 涿鹿县| 枞阳县| 江永县| 永嘉县| 如东县| 丹凤县| 合山市| 青田县| 安多县| 吉安县| 盐津县| 渝北区| 印江| 新野县| 鄯善县| 姜堰市| 英山县| 太保市| 建阳市| 永胜县| 金沙县| 托克托县| 汶川县| 景宁| 吉安市| 德化县| 同仁县| 通州区| 凤阳县| 开原市| 准格尔旗| 清河县| 清流县| 龙山县|