src/Twig/Extension/NetworkingHelperExtension.php
public function getFileIcon($filename)
    {
        $parts = explode('.', $filename);
        $postfix = strtolower(end($parts));
        switch ($postfix) {
            case 'doc':
            case 'docx':
                $icon = 'far fa-file-word';
                break;
            case 'pdf':
                $icon = 'far fa-file-pdf';
                break;
            case 'xls':
            case 'xlsx':
                $icon = 'far fa-file-excel';
                break;
            case 'ppt':
            case 'pptx':
                $icon = 'far fa-file-powerpoint';
                break;
            case 'zip':
                $icon = 'far fa-file-archive';
                break;
            case 'txt':
            case 'rtf':
                $icon = 'far fa-file-alt';
                break;
            case 'png':
            case 'gif':
            case 'jpeg':
            case 'jpg':
            case 'svg':
                $icon = 'far fa-file-image';
                break;
            default:
                $icon = 'far fa-file';
                break;

        }

        return 'fa '.$icon;
    }
public function getFileIcon($filename)
    {
        $parts = explode('.', $filename);
        $postfix = strtolower(end($parts));
        switch ($postfix) {
            case 'doc':
            case 'docx':
                $icon = 'far fa-file-word';
                break;
            case 'pdf':
                $icon = 'far fa-file-pdf';
                break;
            case 'xls':
            case 'xlsx':
                $icon = 'far fa-file-excel';
                break;
            case 'ppt':
            case 'pptx':
                $icon = 'far fa-file-powerpoint';
                break;
            case 'zip':
                $icon = 'far fa-file-archive';
                break;
            case 'txt':
            case 'rtf':
                $icon = 'far fa-file-alt';
                break;
            case 'png':
            case 'gif':
            case 'jpeg':
            case 'jpg':
            case 'svg':
                $icon = 'far fa-file-image';
                break;
            default:
                $icon = 'far fa-file';
                break;

        }

        return 'fa '.$icon;
    }
public function getFileIcon ( $ filename ) { $ parts = explode ( '.' , $ filename ) ; $ postfix = strtolower ( end ( $ parts ) ) ; switch ( $ postfix ) { case 'doc' : case 'docx' : $ icon = 'far fa-file-word' ; break ; case 'pdf' : $ icon = 'far fa-file-pdf' ; break ; case 'xls' : case 'xlsx' : $ icon = 'far fa-file-excel' ; break ; case 'ppt' : case 'pptx' : $ icon = 'far fa-file-powerpoint' ; break ; case 'zip' : $ icon = 'far fa-file-archive' ; break ; case 'txt' : case 'rtf' : $ icon = 'far fa-file-alt' ; break ; case 'png' : case 'gif' : case 'jpeg' : case 'jpg' : case 'svg' : $ icon = 'far fa-file-image' ; break ; default : $ icon = 'far fa-file' ; break ; } return 'fa ' . $ icon ; }
Guess which fontawesome icon to use.

@param $filename

@return string
Guess which fontawesome icon to use .