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

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.

主站蜘蛛池模板: 西丰县| 文安县| 高陵县| 云龙县| 尤溪县| 兴文县| 赣榆县| 巧家县| 凤阳县| 林周县| 乌拉特前旗| 漾濞| 伊通| 眉山市| 吴桥县| 张家港市| 县级市| 漾濞| 刚察县| 阳泉市| 文登市| 英山县| 开封市| 诸城市| 诏安县| 赣州市| 永靖县| 竹北市| 固阳县| 三都| 安平县| 通州区| 墨玉县| 凤山市| 平安县| 堆龙德庆县| 剑河县| 浪卡子县| 稷山县| 洛阳市| 章丘市|