prestashop_newuser Posted February 13, 2016 Share Posted February 13, 2016 I am developing a custom module in prestashop. In that I have taken value inside a function like this $fname = !empty(Tools::getValue('fname')) ? Tools::getValue('fname') : ' '; but its showing error like this Fatal error: Can't use function return value in write context So can someone tell me why the error is here? How to solve this issue? Link to comment Share on other sites More sharing options...
NemoPS Posted February 13, 2016 Share Posted February 13, 2016 You can't use empty there, just use "Tools::getValue('fname') ?" 1 Link to comment Share on other sites More sharing options...
prestashop_newuser Posted February 13, 2016 Author Share Posted February 13, 2016 You can't use empty there, just use "Tools::getValue('fname') ?" I have to use condition there I mean when $fname is empty then the value should be just blank. Then how to use that? Link to comment Share on other sites More sharing options...
NemoPS Posted February 13, 2016 Share Posted February 13, 2016 The way I said Tools::getValue('fname') ? Tools::getValue('fname') : ' '; 1 Link to comment Share on other sites More sharing options...
prestashop_newuser Posted February 13, 2016 Author Share Posted February 13, 2016 The way I said Tools::getValue('fname') ? Tools::getValue('fname') : ' '; Hi, Thanks for the answer. That worked. Thanks again 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