Class humhub\modules\file\libs\FileHelper

Inheritancehumhub\modules\file\libs\FileHelper » yii\helpers\FileHelper
Available since version1.2

FileHelper

Public Methods

Hide inherited methods

MethodDescriptionDefined By
createLink() Creates a file with options humhub\modules\file\libs\FileHelper
getContentContainer() Determines the content container of a File record humhub\modules\file\libs\FileHelper
getExtension() Returns the extension of a file humhub\modules\file\libs\FileHelper
getFileInfos() Returns general file infos as array These information are mainly used by the frontend JavaScript application to handle files. humhub\modules\file\libs\FileHelper
hasExtension() Checks if given fileName has a extension humhub\modules\file\libs\FileHelper

Method Details

createLink() public static method (available since version 1.2)

Creates a file with options

public static string createLink ( humhub\modules\file\models\File $file, $options = [], $htmlOptions = [] )
$file humhub\modules\file\models\File
$options
$htmlOptions
return string

The rendered HTML link

getContentContainer() public static method (available since version 1.2)

Determines the content container of a File record

public static humhub\modules\content\components\ContentContainerActiveRecord getContentContainer ( humhub\modules\file\models\File $file )
$file humhub\modules\file\models\File
return humhub\modules\content\components\ContentContainerActiveRecord

The content container or null

getExtension() public static method

Returns the extension of a file

public static string getExtension ( $fileName )
$fileName string|humhub\modules\file\models\File

The filename or File model

return string

The extension

getFileInfos() public static method (available since version 1.2)

Returns general file infos as array These information are mainly used by the frontend JavaScript application to handle files.

public static array getFileInfos ( humhub\modules\file\models\File $file )
$file humhub\modules\file\models\File

The file

return array

The file infos

hasExtension() public static method

Checks if given fileName has a extension

public static boolean hasExtension ( $fileName )
$fileName string

The filename

return boolean

Has extension