webdhm Posted June 5, 2014 Share Posted June 5, 2014 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 More sharing options...
PascalVG Posted June 6, 2014 Share Posted June 6, 2014 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 More sharing options...
webdhm Posted June 7, 2014 Author Share Posted June 7, 2014 Hi, thanks for the answer. The issue is with the following issue: Header('content-type:.application/xml'); I don't want to redirect just set the mime type. thanks, 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