Zend Framework: Controller Plugins vs Action Helpers

后端 未结 5 760
不知归路
不知归路 2020-12-13 14:21

Could someone give few tips and/or examples how Controller Plugins and Action Helpers are different? Are there situations where particular task could be accomplished with on

5条回答
  •  孤街浪徒
    2020-12-13 15:09

    Action helpers also have access to the actual controlller object that's being executed. Controller Plugins only have access to the FrontController, and therefore only the controller and action name.

    Which you use depends on what context you need. If you need to access a view object attached to a controller, for example, you will want an Action Helper.

提交回复
热议问题