Jump to content

How escape HTML tag in hookDisplayHeader return ?


Recommended Posts

Hello

 

I'm newbie in Presta 1.6 addon  development. I want to make an addon that can be configured with a javascript code to insert in the page header.

 

To do that, in the getContent function I display a configuration form with only one field (textarea), named 'js_code'.

 

Then to display this js_code field content in the header, I use the hookDisplayHeader function in my addon and just return this like :

public function hookDisplayHeader($params)
{
    return Configuration::get(Tools::strtoupper($this->name).'_JS_CODE');
}

But in this function all HTML tags are removed from the JS_CODE variable. I tried to use ddd(Configuration::get(Tools::strtoupper($this->name).'_JS_CODE')) in this function and HTML tags are removed.

 

If I go back to the configuration form of the addon, HTML tags are removed from the js_code field too...

 

How can I keep this HTML tags ?

 

Thanks for your help

 

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...