src/Rules.php
public static function validateImage(UploadControl $control)
	{
		/* @var $file FileUpload */
		$file = $control->getValue();

		if (!in_array($file->getContentType(), ['image/gif', 'image/png', 'image/jpeg', 'image/svg+xml'], true)) {
			return false;
		}
		return true;
	}
public static function validateImage(UploadControl $control)
	{
		/* @var $file FileUpload */
		$file = $control->getValue();

		if (!in_array($file->getContentType(), ['image/gif', 'image/png', 'image/jpeg', 'image/svg+xml'], true)) {
			return false;
		}
		return true;
	}
public static function validateImage ( UploadControl $ control ) { /* @var $file FileUpload */ $ file = $ control -> getValue ( ) ; if ( ! in_array ( $ file -> getContentType ( ) , [ 'image/gif' , 'image/png' , 'image/jpeg' , 'image/svg+xml' ] , true ) ) { return false ; } return true ; }
Validace obrazku + svg
@param IControl $control
@return bool
Validace obrazku + svg