Commit 78254e6c05babc84f6d1f04c8ca0a2f47849a7b6
1 parent
4d304f33
add alt and title to image
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
frontend/views/book/_book.php
... | ... | @@ -8,9 +8,9 @@ |
8 | 8 | <div class="row"> |
9 | 9 | <div class="col-xs-12 col-sm-4 col-md-5 col-lg-6 books-wrapp-img"> |
10 | 10 | <?php if ($model->image !== null){?> |
11 | - <img src="<?='/storage/books/'.$model->id.'/'.$model->image?>" alt=""> | |
11 | + <img src="<?='/storage/books/'.$model->id.'/'.$model->image?>" alt="<?=$model->title.' - '.$model->author->name.' '.$model->author->secondname?>" title="<?=$model->title.' - '.$model->author->name.' '.$model->author->secondname?>"> | |
12 | 12 | <?php }else{ ?> |
13 | - <img src="<?='/storage/books/nobook_01.png'?>" alt=""> | |
13 | + <img src="<?='/storage/books/nobook_01.png'?>" alt="<?=$model->title.' - '.$model->author->name.' '.$model->author->secondname?>" title="<?=$model->title.' - '.$model->author->name.' '.$model->author->secondname?>"> | |
14 | 14 | <?php } ?> |
15 | 15 | </div> |
16 | 16 | <div class="col-xs-12 col-sm-8 col-md-7 col-lg-6 books-wrapp-text"> | ... | ... |
frontend/views/book/view.php
... | ... | @@ -73,10 +73,10 @@ $this->registerJs($js, View::POS_READY); |
73 | 73 | <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3 card-img-col"> |
74 | 74 | <?php if ($model->image !== null){?> |
75 | 75 | <div class="card-img"> |
76 | - <?=ImageHelper::set('@storage/books/'.$model->id.'/'.$model->image)->cropResize(262, 390)->renderImage()?> | |
76 | + <?=ImageHelper::set('@storage/books/'.$model->id.'/'.$model->image)->cropResize(262, 390)->renderImage([ 'alt'=> $model->title.' - '.$model->author->name.' '.$model->author->secondname, 'title' => $model->title.' - '.$model->author->name.' '.$model->author->secondname])?> | |
77 | 77 | </div> |
78 | 78 | <?php }else{ ?> |
79 | - <img src="<?='/storage/books/nobook_01.png'?>" alt=""> | |
79 | + <img src="<?='/storage/books/nobook_01.png'?>" alt="<?=$model->title.' - '.$model->author->name.' '.$model->author->secondname?>" title="<?=$model->title.' - '.$model->author->name.' '.$model->author->secondname?>"> | |
80 | 80 | <?php } ?> |
81 | 81 | </div> |
82 | 82 | <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4"> | ... | ... |