Модуль блога подключен к Yii2 в vendore, в CSS прописано: .grid-view td > img {max-width: 50px; } но все равно размер заглушки не уменьшается( 
Blog.php
<?php
namespace medeyacom\blog\models;
use common\components\behaviors\StatusBehavior;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
use yii\db\Expression;
use yii\web\UploadedFile;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use common\models\ImageManager;
use common\models\User;
/**
- This is the model class for table "blog".
- @property integer $id
- @property string $title
- @property string $image
- @property string $text
- @property string $date_create
- @property string $date_update
- @property string $url
- @property integer $status_id
- @property integer $sort
*/
class Blog extends ActiveRecord {
const STATUS_LIST = ['off','on'];
const IMAGES_SIZE = [
['50','50'],
['800',null],
];
public $tags_array;
public $file;
/**
* @inheritdoc
*/
public static function tableName()
{
return 'blog';
}
public function behaviors()
{
return [
'timestampBehavior'=>[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'date_create',
'updatedAtAttribute' => 'date_update',
'value' => new Expression('NOW()'),
],
'statusBehavior'=> [
'class' => StatusBehavior::className(),
'statusList'=> self::STATUS_LIST,
]
];
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['title', 'url'], 'required'],
[['text'], 'string'],
[['url'], 'unique'],
[['status_id', 'sort'], 'integer'],
[['sort'], 'integer','max'=>99, 'min'=>1],
[['title', 'url'], 'string', 'max' => 150],
[['image'], 'string', 'max' => 100],
[['image'], 'file', 'extensions'=>'jpg, gif, png, svg'],
[['file'], 'image'],
[['tags_array','date_create','date_update'],'safe'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'title' => 'Заголовок',
'text' => 'Текст',
'url' => 'ЧПУ',
'status_id' => 'Статус',
'sort' => 'Сортировка',
'date_update' => 'Обновлено',
'date_create' => 'Создано',
'tags_array' => 'Тэги',
'tagsAsString' => 'Тэги',
'image' => 'Картинка',
'file' => 'Картинка',
'author.username'=>'Имя Автора',
'author.email'=>'Почта Автора',
];
}
public function getAuthor () {
return $this->hasOne (User::className(),['id'=>'user_id']);
}
public function getImages()
{
return $this->hasMany(ImageManager::className(), ['item_id' => 'id'])->andWhere(['class'=>self::tableName()])->orderBy('sort');
}
public function getImagesLinks()
{
return ArrayHelper::getColumn($this->images,'imageUrl');
}
public function getImagesLinksData()
{
return ArrayHelper::toArray($this->images,[
ImageManager::className() => [
'caption'=>'name',
'key'=>'id',
]]
);
}
public function getBlogTag () {
return $this->hasMany(BlogTag::className(),['blog_id'=>'id']);
}
public function getTags()
{
return $this->hasMany(Tag::className(),['id'=>'tag_id'])->via('blogTag');
}
public function getTagsAsString()
{
$arr = \yii\helpers\ArrayHelper::map($this->tags,'id','name');
return implode (', ',$arr);
}
public function getSmallImage()
{
if($this->image){
$path = str_replace('admin.','',Url::home(true)).'uploads/images/blog/50x50/'.$this->image;
}else{
$path = str_replace('admin.','', Url::home(true)).'uploads/images/nophoto.svg';
}
return $path;
}
public function afterFind()
{
parent::afterFind();
$this->tags_array = $this->tags;
}
public function beforeSave ($insert)
{
if ($file = UploadedFile::getInstance($this,'file')) {
$dir = Yii::getAlias('@images').'/blog/';
if (!is_dir($dir . $this->image)) {
if (file_exists($dir.$this->image)){
unlink($dir.$this->image);
}
if (file_exists($dir.'50x50/'.$this->image)) {
unlink($dir.'50x50/'.$this->image);
}
if (file_exists($dir. '800x/'.$this->image)) {
unlink($dir.'800x/'.$this->image);
}
}
$this->image = strtotime ('now').'_'.Yii::$app->getSecurity()->generateRandomString(6) .'.'. $file->extension;
$file ->saveAs($dir.$this->image);
$imag = Yii::$app->image->load($dir.$this->image);
$imag ->background ('#fff',0);
$imag ->resize ('50','50', Yii\image\drivers\Image::INVERSE);
$imag ->crop ('50','50');
$imag ->save($dir.'50x50/'.$this->image, 90);
$imag = Yii::$app->image->load($dir.$this->image);
$imag->background('#fff',0);
$imag->resize('800',null, Yii\image\drivers\Image::INVERSE);
$imag->save($dir.'800x/'.$this->image, 90);
}
return parent::beforeSave($insert);
}
public function afterSave ($insert, $changedAttributes)
{
parent::afterSave($insert, $changedAttributes);
$arr = \yii\helpers\ArrayHelper::map($this->tags,'id','id');
foreach ($this->tags_array as $one) {
if(!in_array($one,$arr)){
$model = new BlogTag();
$model->blog_id = $this->id;
$model->tag_id = $one;
$model->save();
}
if(isset($arr[$one])) {
unset ($arr[$one]);
}
}
BlogTag::deleteAll(['tag_id'=>$arr]);
}
public function beforeDelete()
{
if (parent::beforeDelete()) {
$dir = Yii::getAlias('@images').'/blog/';
if(file_exists($dir.$this->image)){
unlink($dir.$this->image);
}
foreach (self::IMAGES_SIZE as $size){
$size_dir = $size[0].'x';
if($size[1] !== null)
$size_dir .= $size[1];
if(file_exists($dir.$this->image)){
unlink($dir.$size_dir.'/'.$this->image);
}
}
BlogTag::deleteAll(['blog_id'=>$this->id]);
return true;
} else {
return false;
}
}
}
CSS SVG
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500" viewBox="0 0 500.00001 500.00001"><path d="M205.787 493.568c-157.9-26.504-246.857-201.682-177.6-349.744 85.36-182.49 351.91-185.57 441.307-5.098 91.224 184.158-60.92 388.88-263.707 354.842zm99.038-34.836c31.25-8.674 79.184-34.717 83.206-45.21 1.277-3.325-294.462-301.13-299.04-301.13-4.517 0-20.218 22.372-30.804 43.89-80.533 163.703 72.113 350.89 246.64 302.45zM104.843 349.065c-12.468-6.225-12.476-6.275-12.476-86.468 0-79.512.01-79.59 11.773-86.543 22.78-13.467 90.532 44.178 82.108 69.86-18.68 56.95 48.65 115.263 92.877 80.437 1.935-1.523 5.993 1.415 16.55 11.98 13.537 13.55-165.074 23.595-190.832 10.735zm317.906 29.113c106.74-135.61 2.872-340.836-172.5-340.836-53.517 0-128.95 27.877-137.784 50.92-1.275 3.326 294.464 301.132 299.042 301.132 1.326 0 6.385-5.047 11.24-11.216zm-69.57-66.325c-38.348-38.527-38.348-38.527-40.446-50.23-5.747-32.08-27.69-53.273-60.536-58.47-8.16-1.29-46.78-34.694-46.78-40.46 0-19.49 64.18-15.8 93.36 5.367 5.686 4.124 8.767 4.804 21.77 4.804 19.174 0 20.825-.705 23.314-9.954 2.97-11.043 19.437-10.66 19.437.45 0 6.112 5.592 9.504 15.666 9.504 28.496 0 29.164 2.062 29.164 90.088 0 77.795.06 77.264-9.657 84.927-5.184 4.088-6.06 3.39-45.294-36.027zm-85.502-132.226c12.81-13.055 2.866-26.27-19.77-26.27-20.12 0-29.718 7.925-24.914 20.57 4.056 10.677 35.824 14.73 44.684 5.7z" fill="#cbcbcb"/></svg>
