Jump to content

prestashop 1.6 module how to add header other than Location


webdhm

Recommended Posts

Hi,

I'm trying to validate a module and I'm getting the following error:

 

The use of function header() is forbidden; use Tools::redirect() instead

but the headers I want to use are:

Header('Status: 301 Moved Permanently', false, 301);

Header('content-type:.application/xml');

 

what are the alternative?

 

thanks in advanced

Link to comment
Share on other sites

You can add additional headers to the function that are sent first before the redirect:

 

/**
* Redirect user to another page
*
* @param string $url Desired URL
* @param string $baseUri Base URI (optional)
* @param Link $link
* @param string|array $headers A list of headers to send before redirection
*/
public static function redirect($url, $base_uri = __PS_BASE_URI__, Link $link = null, $headers = null)
 
 
 
Will that work for you?
pascal
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...