prestashop_newuser Posted February 14, 2014 Share Posted February 14, 2014 Hi, I am doing a small module in prestashop. In that module I have used global $cookie, $smarty; for both smarty and cookie as global. It is working fine with prestashop 1.5.6.1. Now when I tried to validate the module in http://validator.prestashop.com/module then after all the process of validation it showed me an error like Use of globals is forbidden Now If I am using global value smarty as $this->context->cookie = $cookie and for smarty I am using $this->smarty then it is showing as undefined variable for both smarty and cookie. So to make that clear how this has been done in other modules I have gone through prestashop own module blocklayered and I have seen in that module both global $cookie; and global $smarty; has been used. I have checked this with prestashop 1.5.6.1. and new 1.6.0.3 version. So can someone kindly tell me what's the wrong here. The same code is woring in another module and that code is in my custom module showing validation error? Why? Any help and suggestions will be really appreciable. Thanks Link to comment Share on other sites More sharing options...
vekia Posted February 14, 2014 Share Posted February 14, 2014 can you show the code where you're trying to use $this->context->cookie and $this->smarty Link to comment Share on other sites More sharing options...
vekia Posted February 14, 2014 Share Posted February 14, 2014 duplicated: http://www.prestashop.com/forums/topic/294352-globals-are-deprecated-please-use-the-context-instead/ Link to comment Share on other sites More sharing options...
Recommended Posts