F
F
FromHeaven2021-05-07 13:51:02
Yii
FromHeaven, 2021-05-07 13:51:02

How to change text in template using event?

There is an application source code that is highly undesirable to touch.
I need, using a new module, using an event to change the text inside the templates. For example, throughout the site there is the phrase "Old text" that I need to replace with "New text".
I have created a new module. Presumably, using the EVENT_BEFORE_RENDER event handler, replace the template.
I assume that I need to use the event to pick up the moment when the template is rendered, and then from my module write the function to replace the string I need.
I still can't figure out how to write events. I found a function in the controller that renders one of the templates I need, but I can’t figure out what to do next.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question