Remplacer une valeur

More
12 years 11 months ago #21326 by kim
Remplacer une valeur was created by kim
Bonjour,

Je voudrais faire une condition dans l'affichage des champs dans une table.
Code:
<?php echo isset($item->positions['table']->{$name}->display) ? $item->positions['table']->{$name}->display : ''; ?>

Si la valeur est '33', affiché 'NC'.

J'arrive pas à intégrer ma bouche if / else.

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #21328 by kim
Replied by kim on topic Remplacer une valeur
bon en enlevant le isset, j'ai un truc comme ca qui fonctionne...
Code:
<?php if ($item->positions['table']->{$name}->display=="33") {echo 'NC';} else {echo $item->positions['table']->{$name}->display;} ?>

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.330 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline