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

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.

主站蜘蛛池模板: 青神县| 大田县| 凤冈县| 滦南县| 浮梁县| 邯郸县| 巫溪县| 苏尼特右旗| 藁城市| 滕州市| 清涧县| 方正县| 昆明市| 大厂| 中方县| 涞源县| 宁海县| 金平| 宣城市| 桂林市| 陆河县| 旬阳县| 杂多县| 新绛县| 方山县| 尚志市| 锦州市| 黑山县| 青铜峡市| 文安县| 鸡泽县| 新竹县| 图们市| 福清市| 深泽县| 嘉鱼县| 醴陵市| 富裕县| 稻城县| 秭归县| 洪泽县|