chg: [boolean] field added to the single view fields

pull/6585/head
iglocska 2020-11-11 10:49:21 +01:00
parent d6c4e693ce
commit a8addc3378
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
<?php
$value = Hash::extract($data, $field['path']);
echo sprintf(
'<i class="fas fa-%s"></i>',
empty($value[0]) ? 'times' : 'check'
);
$value = Hash::extract($data, $field['path'])[0];
$mapping = !empty($field['mapping']) ? $field['mapping'] : [
false => '<i class="fas fa-times"></i>',
true => '<i class="fas fa-check"></i>'
];
echo $mapping[(bool)$value];