Class humhub\modules\file\validators\ImageSquareValidator

Inheritancehumhub\modules\file\validators\ImageSquareValidator » yii\validators\FileValidator

ImageSquareValidator checks if uploaded image is squared.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$noSquaredImage string The error message used when the uploaded file is not a squared image. humhub\modules\file\validators\ImageSquareValidator

Public Methods

Hide inherited methods

MethodDescriptionDefined By
init() {@inheritdoc} humhub\modules\file\validators\ImageSquareValidator

Property Details

$noSquaredImage public property

The error message used when the uploaded file is not a squared image. You may use the following tokens in the message:

  • {attribute}: the attribute name
  • {file}: the uploaded file name
public string $noSquaredImage null

Method Details

init() public method

{@inheritdoc}

public void init ( )
validateImage() protected method

Validates an image file.

protected array|null validateImage ( $image )
$image \yii\web\UploadedFile

Uploaded file passed to check against a set of rules

return array|null

The error message and the parameters to be inserted into the error message. Null should be returned if the data is valid.

validateValue() protected method

{@inheritdoc}

protected void validateValue ( $value )
$value