我如何使用Yii2 Glide
我已经使用了yii2文件包。现在我想通过滑动调整缩略图的大小,但我在日志中遇到了错误我如何使用Yii2 Glide,yii2,starter-kits,Yii2,Starter Kits,我已经使用了yii2文件包。现在我想通过滑动调整缩略图的大小,但我在日志中遇到了错误 "NetworkError: 500 Internal Server Error - http://storage.local/cache/1/iApQj79NQCji2TWsLZppiCQ8lbdgAPBz.jpg?w=100" 这是我的配置 'components' => [ 'cache' => [ 'class' => 'yii\caching\DummyC
"NetworkError: 500 Internal Server Error - http://storage.local/cache/1/iApQj79NQCji2TWsLZppiCQ8lbdgAPBz.jpg?w=100"
这是我的配置
'components' => [
'cache' => [
'class' => 'yii\caching\DummyCache',
],
'fileStorage' => [
'class' => '\trntv\filekit\Storage',
'baseUrl' => '@storageUrl/source',
'filesystem' => [
'class' => 'common\components\filesystem\LocalFlysystemBuilder',
'path' => '@storage/web/source'
],
'as log' => [
'class' => 'common\behaviors\FileStorageLogBehavior',
'component' => 'fileStorage'
]
],
'glide' => [
'class' => 'trntv\glide\components\Glide',
'sourcePath' => '@storage/web/source',
'cachePath' => '@storage/cache',
'urlManager' => 'urlManagerStorage',
'maxImageSize' => 4000000,
'signKey' => 'pe4AJmRcBFbXfZvsk93VN'
],
在我看来
<?= Html::img(
Yii::$app->glide->createSignedUrl([
'glide/index',
'path' => $model->productAttachments[0]->path,
'w' => 100
], true),
['class' => 'article-thumb img-rounded pull-left']
) ?>
我只看了一下初学者工具包配置,这里有和我看到的相同的配置。存储配置与Yi2初学者工具包相同。有关详细信息,请显示调试。或者您可以通过以下方式输出图像: Url::base(true)。'/glide?path='.$path.&w='.$w.&h='.$h.&fit=crop'