Common\Core\Twig\Extensions\BaseTwigModifiers::showBool PHP Method

showBool() public static method

syntax: {{ showbool($status, $reverse) }}.
public static showBool ( string | boolean $status, boolean $reverse = false ) : string
$status string | boolean
$reverse boolean show the opposite of the status
return string
    public static function showBool($status, $reverse = false)
    {
        $showTrue = '<strong style="color:green">&#10003;</strong>';
        $showFalse = '<strong style="color:red">&#10008;</strong>';
        if ($reverse) {
            if ($status === 'Y' || $status === 'y' || $status === 1 || $status === '1' || $status === true) {
                return $showFalse;
            }
            if ($status === 'N' || $status === 'n' || $status === 0 || $status === '0' || $status === false) {
                return $showTrue;
            }
            return $status;
        }
        if ($status === 'Y' || $status === 'y' || $status === 1 || $status === '1' || $status === true) {
            return $showTrue;
        }
        if ($status === 'N' || $status === 'n' || $status === 0 || $status === '0' || $status === false) {
            return $showFalse;
        }
        return $status;
    }