Jump to content

module extends ObjectModel or override without using override directory


web20matrix

Recommended Posts

I need to parse any variable passed to any static page in Prestashop and replace anything that starts with "http" (in plain text) with "a href"s. I already have the regular expression but I need to know how can I do that using a module without modifying the core functions and without using override directory for classes or controllers.

 

The variables needs to be parsed BEFORE sending the result to tpl files; I already found a solution overriding ObjectModel class but I need to do this inside a module. The problem is that it is not clear to me how I can do that because ObjectModel grabs data from database using its constructor.

 

Somehow I need to override ObjectModel constructor within my module and be able to parse the database values before sending data to any tpl included on page.

Link to comment
Share on other sites

simply put, I am trying to develop a standalone module that grabs all data from database before it is displayed and replaces text based on a regular expression. Overriding ObjectModel is not a solution because someone else might override it too

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...