Class humhub\modules\file\converter\TextConverter

Inheritancehumhub\modules\file\converter\TextConverter » humhub\modules\file\converter\BaseConverter » yii\base\BaseObject
Available since version1.3

Text Converter

Public Methods

Hide inherited methods

MethodDescriptionDefined By
applyFile() Sets file for the converter humhub\modules\file\converter\BaseConverter
getContentAsText() Returns the file content as text humhub\modules\file\converter\TextConverter
getConverter() Returns the first matching converter for the file humhub\modules\file\converter\TextConverter
getFilename() Returns the filename of the converted file. humhub\modules\file\converter\BaseConverter
getUrl() Returns the url to the converted file humhub\modules\file\converter\BaseConverter
init() humhub\modules\file\converter\BaseConverter

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
canConvert() Returns if the given file can be converted humhub\modules\file\converter\TextConverter
convert() Convert file humhub\modules\file\converter\TextConverter

Property Details

$converter public property
public array $converter = []

Method Details

canConvert() protected method

Returns if the given file can be converted

protected void canConvert ( humhub\modules\file\models\File $file )
$file
convert() protected method

Convert file

protected void convert ( $fileName )
$fileName
getContentAsText() public method

Returns the file content as text

public string getContentAsText ( )
return string

The text output

getConverter() public method

Returns the first matching converter for the file

public array getConverter ( )
return array

The converter definitions