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

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.

主站蜘蛛池模板: 萝北县| 灵石县| 哈巴河县| 平利县| 岢岚县| 东辽县| 盘山县| 介休市| 保山市| 得荣县| 峨边| 北川| 电白县| 古田县| 玛曲县| 大连市| 彭水| 江陵县| 柏乡县| 珠海市| 台湾省| 武川县| 汉川市| 红桥区| 浙江省| 宾阳县| 东安县| 芦山县| 吉木萨尔县| 沙洋县| 新津县| 永善县| 苗栗县| 体育| 沧州市| 普兰店市| 正蓝旗| 中阳县| 贵南县| 玉田县| 嘉义市|