I have a custom Block, and I want to run some code before this block will be rendered. How to achieve this?
I don't want to place my code inside Block method and run it from the template.
I don't want to place my code inside __construct
, because it's no good for performance.
I think there is a maybe some event in Magento, that I can use for this.
I will be glad to any thoughts. Thanks.