ImageResize.php
public function getUrl($filePath, $width, $height, $mode = "outbound", $quality = null, $fileName = null) {
		//get original file 
		$normalizePath = FileHelper::normalizePath(Yii::getAlias($filePath));
		//get cache url
		$filesUrls = [];
		foreach ($this->cachePath as $cachePath)
		{
			$cacheUrl = Yii::getAlias($cachePath);
			//generate file
			$resizedFilePath = self::generateImage($normalizePath, $width, $height, $mode, $quality, $fileName);
			//get resized file
			$normalizeResizedFilePath = FileHelper::normalizePath($resizedFilePath);
			$resizedFileName          = pathinfo($normalizeResizedFilePath, PATHINFO_BASENAME);
			//get url
			$sFileUrl = Url::to('@web/' . $cacheUrl . '/' . substr($resizedFileName, 0, 2) . '/' . $resizedFileName, $this->absoluteUrl);

			//return path
			$filesUrls[] = $sFileUrl;
		}

		return $filesUrls[0];
	}
public function getUrl($filePath, $width, $height, $mode = "outbound", $quality = null, $fileName = null) {
		//get original file 
		$normalizePath = FileHelper::normalizePath(Yii::getAlias($filePath));
		//get cache url
		$filesUrls = [];
		foreach ($this->cachePath as $cachePath)
		{
			$cacheUrl = Yii::getAlias($cachePath);
			//generate file
			$resizedFilePath = self::generateImage($normalizePath, $width, $height, $mode, $quality, $fileName);
			//get resized file
			$normalizeResizedFilePath = FileHelper::normalizePath($resizedFilePath);
			$resizedFileName          = pathinfo($normalizeResizedFilePath, PATHINFO_BASENAME);
			//get url
			$sFileUrl = Url::to('@web/' . $cacheUrl . '/' . substr($resizedFileName, 0, 2) . '/' . $resizedFileName, $this->absoluteUrl);

			//return path
			$filesUrls[] = $sFileUrl;
		}

		return $filesUrls[0];
	}
public function getUrl ( $ filePath , $ width , $ height , $ mode = "outbound" , $ quality = null , $ fileName = null ) { //get original file 
 $ normalizePath = FileHelper :: normalizePath ( Yii :: getAlias ( $ filePath ) ) ; //get cache url
 $ filesUrls = [ ] ; foreach ( $ this -> cachePath as $ cachePath ) { $ cacheUrl = Yii :: getAlias ( $ cachePath ) ; //generate file
 $ resizedFilePath = self :: generateImage ( $ normalizePath , $ width , $ height , $ mode , $ quality , $ fileName ) ; //get resized file
 $ normalizeResizedFilePath = FileHelper :: normalizePath ( $ resizedFilePath ) ; $ resizedFileName = pathinfo ( $ normalizeResizedFilePath , PATHINFO_BASENAME ) ; //get url
 $ sFileUrl = Url :: to ( '@web/' . $ cacheUrl . '/' . substr ( $ resizedFileName , 0 , 2 ) . '/' . $ resizedFileName , $ this -> absoluteUrl ) ; //return path
 $ filesUrls [ ] = $ sFileUrl ; } return $ filesUrls [ 0 ] ; }
Creates and caches the image and returns URL from resized file.

@param string $filePath to original file
@param integer $width
@param integer $height
@param string $mode
@param integer $quality (1 - 100 quality)
@param string $fileName (custome filename)
@return string
Creates and caches the image and returns URL from resized file .