-- สร้างไฟล์ service.yml ในโฟลเดอร์ config เพื่อที่จะเป็นเสมือนส่วนที่จะช่วยปรับเปลี่ยนการเรียกใช้งาน โดยแทนที่เมื่อมีการแจ้งเตือน จะส่วนไปยังไฟล์ระบบของ phpbb ก็ให้มาใช้งานไฟล์ที่กำหนดไว้ใน Extension ที่สร้างขึ้นมาแทน
*-- ตัวอย่างที่สร้างขึ้น
โค้ด: เลือกทั้งหมด
notification.type.post: //ชนิดของการแจ้งเตือน
class: mindphp\m_anonymous\notification\post //ตำแหน่งที่เก็บไฟล์
shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
- [set_config, ['@config']]
tags:
- { name: notification.type }
notification.type.bookmark:
class: mindphp\m_anonymous\notification\bookmark
shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
- [set_config, ['@config']]
tags:
- { name: notification.type }
notification.type.topic:
class: mindphp\m_anonymous\notification\topic
shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
- [set_config, ['@config']]
tags:
- { name: notification.type }
notification.type.quote:
class: mindphp\m_anonymous\notification\quote
shared: false
parent: notification.type.post
calls:
- [set_utils, ['@text_formatter.utils']]
tags:
- { name: notification.type }
โดยทั้งนี้สามารถดูวิธีการเรียกใช้งาน การแจ้งเตือนอื่นๆ เพื่อที่จะนำมา Overrite ได้จาก config/default/container/services_notification.yml
บทความที่เกี่ยวข้อง
การสร้าง Extension ใน phpbb
การสร้าง controller สำหรับ phpbb
Event listenner - เขียน Extension บน phpBB 3.1