legacy12 Posted December 1, 2016 Share Posted December 1, 2016 Hello, I want to use this code: if(file_exists(_PS_MODULE_DIR_.'pc_orderspanel/views/templates/admin/_configure/'.$this->base_folder.$tpl_name) && Tools::getValue('controller') != 'AdminProductGrid' && Tools::getValue('controller') != 'AdminProducts') Somehow it is not working. If i remove a part and use this code it is working: if(file_exists(_PS_MODULE_DIR_.'pc_orderspanel/views/templates/admin/_configure/'.$this->base_folder.$tpl_name) && Tools::getValue('controller') != 'AdminProductGrid') How can i add: && Tools::getValue('controller') != 'AdminProducts' Thanks! Luke Link to comment Share on other sites More sharing options...
bellini13 Posted December 1, 2016 Share Posted December 1, 2016 Tools::getValue returns boolean false if the parameter does not exist in GET or POST. So this may not work as you think it does Tools::getValue('controller') != 'AdminProducts') get the value of controller before your if statement, and then check that it has a non-boolean value before executing your if statement Link to comment Share on other sites More sharing options...
legacy12 Posted December 1, 2016 Author Share Posted December 1, 2016 Thanks for you reply. If i Put AdminProducts in the place of AdminProductGrid then the AdminProducts page is working. I have to find a way to combine those two. if(file_exists(_PS_MODULE_DIR_.'pc_orderspanel/views/templates/admin/_configure/'.$this->base_folder.$tpl_name) && Tools::getValue('controller') != 'AdminProducts') Link to comment Share on other sites More sharing options...
bellini13 Posted December 1, 2016 Share Posted December 1, 2016 $value = Tools::getValue('controller'); if ($value && ($value == 'AdminProducts' || $value == 'AdminProductGrid') 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