Design pattern for implementing plugins in PHP applications

后端 未结 6 795
温柔的废话
温柔的废话 2021-01-30 23:15

Is there a consensus on how plugins should be implemented in a PHP application?

I\'ve looked into the observer pattern which comes close, it\'s really just a notificati

6条回答
  •  余生分开走
    2021-01-30 23:30

    Take a look at the Yii framework. Yii heavily relies on events which are much cleaner than hooks, actions, etc. Using events, you can allow different parts of the system to talk to each other in an object oriented manner.

提交回复
热议问题