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

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.

主站蜘蛛池模板: 隆尧县| 通江县| 东乡族自治县| 兴山县| 三门县| 兰溪市| 沁源县| 酉阳| 郴州市| 沾化县| 新巴尔虎右旗| 枣阳市| 平乡县| 于都县| 榆林市| 宜章县| 西和县| 呼伦贝尔市| 诏安县| 奉节县| 东乌珠穆沁旗| 洪湖市| 额敏县| 中阳县| 定南县| 颍上县| 黄陵县| 红桥区| 宁武县| 常熟市| 信丰县| 万荣县| 定兴县| 阳江市| 尼玛县| 保山市| 海南省| 民乐县| 璧山县| 桓台县| 绥芬河市|