Meaning of Event in php

后端 未结 2 612
渐次进展
渐次进展 2021-01-03 12:30

I know php and nodejs too,in javascript we have asynchronize programming ,so I understand meaning of event in it.but I saw Event in Yii and Zend 2 and use t

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-03 13:16

    This article helped me understrand EventManager in ZF2:

    The Event Manager is the component of the framework which allows you to hook in to named events in your application.

    There are an existing set of named events in the framework, such as the dispatch event in controllers. You can also create your own as suits your application’s purpose. That’s step one. Then, you attach (or listen) to those events. When they fire – or are triggered – your code interrogates the context of the event and responds if needed.

    enter image description here

    reference: http://www.maltblue.com/tutorial/zend-framework-2-event-manager-a-gentle-introduction

提交回复
热议问题