PHP 클래스 Cviebrock\ImageValidator\ImageValidator

상속: extends Illuminate\Validation\Validator, implements Illuminate\Contracts\Validation\Validator
파일 보기 프로젝트 열기: cviebrock/image-validator 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Symfony\Component\Translation\TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [] ) Creates a new instance of ImageValidator
replaceImageAspect ( string $message, string $attribute, string $rule, array $parameters ) : string Build the error message for validation failures.
replaceImageSize ( string $message, string $attribute, string $rule, array $parameters ) : string Build the error message for validation failures.
validateImageAspect ( $attribute, $value, $parameters ) : boolean Usage: image_aspect:ratio
validateImageSize ( $attribute, $value, $parameters ) : boolean Usage: image_size:width[,height]

보호된 메소드들

메소드 설명
checkDimension ( string $rule, integer $dimension ) : array Parse the dimension rule and check if the dimension passes the rule.
getImagePath ( $value )

메소드 상세

__construct() 공개 메소드

Creates a new instance of ImageValidator
public __construct ( Symfony\Component\Translation\TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [] )
$translator Symfony\Component\Translation\TranslatorInterface
$data array
$rules array
$messages array
$customAttributes array

checkDimension() 보호된 메소드

Parse the dimension rule and check if the dimension passes the rule.
protected checkDimension ( string $rule, integer $dimension ) : array
$rule string
$dimension integer
리턴 array

getImagePath() 보호된 메소드

protected getImagePath ( $value )

replaceImageAspect() 공개 메소드

Build the error message for validation failures.
public replaceImageAspect ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceImageSize() 공개 메소드

Build the error message for validation failures.
public replaceImageSize ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

validateImageAspect() 공개 메소드

Usage: image_aspect:ratio
public validateImageAspect ( $attribute, $value, $parameters ) : boolean
$attribute string
$value string|array
$parameters array
리턴 boolean

validateImageSize() 공개 메소드

Usage: image_size:width[,height]
public validateImageSize ( $attribute, $value, $parameters ) : boolean
$attribute string
$value string|array
$parameters array
리턴 boolean