jemmeli Posted August 30, 2013 Posted August 30, 2013 hello everybody when i was surfing the module special of prestashop I found the next code : <input type="radio" name="always_display" id="display_on" value="1" '.(Tools::getValue('always_display', Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) ? 'checked="checked" ' : '').'/> it is clear that the code is a code for a radio button but the portion that i did not understood is related to the tast one after the attribute value : (Tools::getValue('always_display', Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) ? 'checked="checked" ' : '') what does it mean this portion ? Share this post Link to post Share on other sites More sharing options...
vekia Posted August 30, 2013 Posted August 30, 2013 this is shorthand if condition. Tools::getValue('always_display') - this code return information about value of always_display field, if it is checked - returns 1 if not, returns null Configuration::get('PS_BLOCK_SPECIALS_DISPLAY') - value stored in configuration table, returns database setting value (1 or null) 'checked="checked" ' : '' if tools::getValue('always_display') == Configuration('PS_BLOCK_SPECIALS_DISPLAY') then script will write 'checked="checked"' if not will write nothing - '' 1 Share this post Link to post Share on other sites More sharing options...
PascalVG Posted August 31, 2013 Posted August 31, 2013 That's clear, Vekia. Thanks. Mark topic as solved pascal 1 Share this post Link to post 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