PHP 클래스 yii\validators\ImageValidator

부터: 2.0
저자: Taras Gudz ([email protected])
상속: extends FileValidator
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$maxHeight the maximum width in pixels. Defaults to null, meaning no limit.
$maxWidth the maximum width in pixels. Defaults to null, meaning no limit.
$minHeight the minimum height in pixels. Defaults to null, meaning no limit.
$minWidth the minimum width in pixels. Defaults to null, meaning no limit.
$notImage the error message used when the uploaded file is not an image. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name
$overHeight the error message used when the image is over [[maxHeight]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[maxHeight]]
$overWidth the error message used when the image is over [[maxWidth]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[maxWidth]]
$underHeight the error message used when the image is under [[minHeight]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[minHeight]]
$underWidth the error message used when the image is under [[minWidth]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[minWidth]]

공개 메소드들

메소드 설명
clientValidateAttribute ( $model, $attribute, $view )
init ( )

보호된 메소드들

메소드 설명
getClientOptions ( $model, $attribute )
validateImage ( UploadedFile $image ) : array | null Validates an image file.
validateValue ( $value )

메소드 상세

clientValidateAttribute() 공개 메소드

public clientValidateAttribute ( $model, $attribute, $view )

getClientOptions() 보호된 메소드

protected getClientOptions ( $model, $attribute )

init() 공개 메소드

public init ( )

validateImage() 보호된 메소드

Validates an image file.
protected validateImage ( UploadedFile $image ) : array | null
$image yii\web\UploadedFile uploaded file passed to check against a set of rules
리턴 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 validateValue ( $value )

프로퍼티 상세

$maxHeight 공개적으로 프로퍼티

the maximum width in pixels. Defaults to null, meaning no limit.
또한 보기: overWidth for the customized message used when image height is too big.
public $maxHeight

$maxWidth 공개적으로 프로퍼티

the maximum width in pixels. Defaults to null, meaning no limit.
또한 보기: overWidth for the customized message used when image width is too big.
public $maxWidth

$minHeight 공개적으로 프로퍼티

the minimum height in pixels. Defaults to null, meaning no limit.
또한 보기: underHeight for the customized message used when image height is too small.
public $minHeight

$minWidth 공개적으로 프로퍼티

the minimum width in pixels. Defaults to null, meaning no limit.
또한 보기: underWidth for the customized message used when image width is too small.
public $minWidth

$notImage 공개적으로 프로퍼티

the error message used when the uploaded file is not an image. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name
public $notImage

$overHeight 공개적으로 프로퍼티

the error message used when the image is over [[maxHeight]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[maxHeight]]
public $overHeight

$overWidth 공개적으로 프로퍼티

the error message used when the image is over [[maxWidth]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[maxWidth]]
public $overWidth

$underHeight 공개적으로 프로퍼티

the error message used when the image is under [[minHeight]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[minHeight]]
public $underHeight

$underWidth 공개적으로 프로퍼티

the error message used when the image is under [[minWidth]]. You may use the following tokens in the message: - {attribute}: the attribute name - {file}: the uploaded file name - {limit}: the value of [[minWidth]]
public $underWidth