remyb Posted September 22, 2016 Share Posted September 22, 2016 Let's say i want to replace all appearance of word "pretty" by "beautiful", everywhere in the website. An easy way to do it is to place ob_start('handlePage') in the file index.php and then the function handlePage can be public function treatPage($html) { return str_replace("pretty","beautiful",$html); } Now, I'm trying to implement this inside the module but it seems that it is not possible as I can't run my code at the beginning of the execution. Do you know if there is a way to place my ob_start at the beginning of execution within a module ? Like some init function ? Thanks. Link to comment Share on other sites More sharing options...
bellini13 Posted September 22, 2016 Share Posted September 22, 2016 You would probably have to create an override of the Controller class and then add your code to the very start of execution. Link to comment Share on other sites More sharing options...
NemoPS Posted September 23, 2016 Share Posted September 23, 2016 init method of the Controller class should do it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now