I can upload and see images by admin panel in back-end application without any problems and see images in the "frontend" yii2 application also, but I have an additional separate front-end application and I can't see images there. It's returns 404 error.
Take one image, for example, that has one URL in all applications, but all applications have different domain names.
My common/config/main.php :
'modules' => [
'yii2images' => [
'class' => 'rico\yii2images\Module',
//be sure, that permissions ok
//if you cant avoid permission errors you have to create "images" folder in web root manually and set 777 permissions
'imagesStorePath' => '@root/upload/store', //path to origin images
'imagesCachePath' => '@root/upload/cache', //path to resized copies
'graphicsLibrary' => 'GD', //but really its better to use 'Imagick'
'placeHolderPath' => '@root/upload/store/no-image.png', // if you want to get placeholder when image not exists, string will be processed by Yii::getAlias
'imageCompressionQuality' => 85, // Optional. Default value is 85.
]
Same code of Costa-Rico/images in all 3 models:
public $gallery;
public $gallery_url;
public function behaviors()
{
return [
'image' => [
'class' => 'rico\yii2images\behaviors\ImageBehave',
]
];
}
In the separate frontend application I trying to show image by with code:
I was trying to use frontend\models\General and creating of own this_separate_application\models\General (ActiveRecord, same table) for this application.
I can upload and see images by admin panel in back-end application without any problems and see images in the "frontend" yii2 application also, but I have an additional separate front-end application and I can't see images there. It's returns 404 error.
Take one image, for example, that has one URL in all applications, but all applications have different domain names.
My common/config/main.php :
Same code of Costa-Rico/images in all 3 models:
In the separate frontend application I trying to show image by with code:
I was trying to use frontend\models\General and creating of own this_separate_application\models\General (ActiveRecord, same table) for this application.
How I can to solve this problem? Thank you.