Class humhub\libs\ProfileBannerImage

Inheritancehumhub\libs\ProfileBannerImage » humhub\libs\ProfileImage
Available since version0.5

ProfileBannerImage is responsible for the profile banner images.

This class handles all tasks related to profile images. Will used for Space or User Profiles.

Prefixes: "" = Resized profile image "_org" = Orginal uploaded file

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$container humhub\modules\content\components\ContentContainerActiveRecord humhub\libs\ProfileImage
$defaultImage String Name of the default image humhub\libs\ProfileImage
$folder_images String Folder name inside the uploads directory humhub\libs\ProfileBannerImage
$guid String Is the guid of user or space humhub\libs\ProfileImage
$height Integer Height of the Image humhub\libs\ProfileBannerImage
$width Integer Width of the Image humhub\libs\ProfileBannerImage

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor of Profile Image humhub\libs\ProfileBannerImage
cropOriginal() Crops the Original Image humhub\libs\ProfileImage
delete() Deletes current profile humhub\libs\ProfileImage
getContainer() humhub\libs\ProfileImage
getPath() Returns the Path of the Modified Profile Image humhub\libs\ProfileImage
getUrl() Returns the URl of the Modified Profile Image humhub\libs\ProfileImage
hasImage() Indicates there is a custom profile image humhub\libs\ProfileImage
render() Renders this profile image humhub\libs\ProfileBannerImage
setNew() Sets a new profile image by given temp file humhub\libs\ProfileBannerImage

Property Details

$folder_images protected property

Folder name inside the uploads directory

protected String $folder_images 'profile_image/banner'
$height protected property

Height of the Image

protected Integer $height 192
$width protected property

Width of the Image

protected Integer $width 1134

Method Details

__construct() public method

Constructor of Profile Image

UserId is optional, if not given the current user will used

public void __construct ( $guid, $defaultImage 'default_banner' )
$guid string
$defaultImage string
render() public method

Renders this profile image

public string render ( $width, $cfg = [] )
$width integer
$cfg array
throws \yii\db\IntegrityException
setNew() public method

Sets a new profile image by given temp file

public void setNew ( $file )
$file \yii\web\UploadedFile
throws \yii\base\Exception