Matus Zeman wrote
> Why can't you simply implement it inside of  showSettingsAction() method?

Because I need a universal method to initialize various elements (before
action), without duplicating my code in every other controller action.
Settings were just an example.


Matus Zeman wrote
> - create protected method inside of the same controller

In some cases this would be enough, but not in every.


Matus Zeman wrote
> You can overwrite protected method attachDefaultListeners() in your 
> controller 
> https://github.com/zendframework/zf2/blob/master/library/Zend/Mvc/Controller/AbstractController.php#L304

Works like a charm, thanks!



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-Doing-something-before-calling-the-controller-action-tp4656922p4656931.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to