function FileMediaFormatterBase::mimeTypeApplies
Same name in other branches
- 9 core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::mimeTypeApplies()
- 10 core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::mimeTypeApplies()
- 11.x core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::mimeTypeApplies()
Check if given MIME type applies to the media type of the formatter.
Parameters
string $mime_type: The complete MIME type.
Return value
bool TRUE if the MIME type applies, FALSE otherwise.
2 calls to FileMediaFormatterBase::mimeTypeApplies()
- FileMediaFormatterBase::getSourceFiles in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileMediaFormatterBase.php - Gets source files with attributes.
- FileMediaFormatterBase::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileMediaFormatterBase.php - Returns if the formatter can be used for the provided field.
File
-
core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileMediaFormatterBase.php, line 171
Class
- FileMediaFormatterBase
- Base class for media file formatter.
Namespace
Drupal\file\Plugin\Field\FieldFormatterCode
protected static function mimeTypeApplies($mime_type) {
list($type) = explode('/', $mime_type, 2);
return $type === static::getMediaType();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.