We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public function actionImageByItemAndAlias($item=''/, $dirtyAlias/) { $dirtyAlias = Yii::$app->request->get('dirtyAlias');
$dotParts = explode('.', $dirtyAlias); if(!isset($dotParts[1])){ throw new \yii\web\HttpException(404, 'Image must have extension'); } $dirtyAlias = $dotParts[0]; $size = isset(explode('_', $dirtyAlias)[1]) ? explode('_', $dirtyAlias)[1] : false; $alias = isset(explode('_', $dirtyAlias)[0]) ? explode('_', $dirtyAlias)[0] : false; $image = $this->getModule()->getImage($item, $alias); if($image->getExtension() != $dotParts[1]){ throw new \yii\web\HttpException(404, 'Image not found (extenstion)'); } if($image){ header('Content-Type: image/jpg'); echo $image->getContent($size); }else{ throw new \yii\web\HttpException(404, 'There is no images'); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
public function actionImageByItemAndAlias($item=''/, $dirtyAlias/)
{
$dirtyAlias = Yii::$app->request->get('dirtyAlias');
The text was updated successfully, but these errors were encountered: