Commit 577130f827c8a3c8b789fe22d9d5a663e42af070
1 parent
1bb3eff2
fixed problem if there is no image for article
Showing
2 changed files
with
17 additions
and
10 deletions
Show diff stats
frontend/views/blog/_article_item.php
| ... | ... | @@ -62,11 +62,15 @@ |
| 62 | 62 | ] |
| 63 | 63 | )?>" |
| 64 | 64 | > |
| 65 | - <?=$model->lang->image->getImg( | |
| 66 | - [ | |
| 67 | - 'class' => "img-responsive" | |
| 68 | - ] | |
| 69 | - )?> | |
| 65 | + <?php | |
| 66 | + if ($model->lang->image) { | |
| 67 | + echo $model->lang->image->getImg( | |
| 68 | + [ | |
| 69 | + 'class' => "img-responsive" | |
| 70 | + ] | |
| 71 | + ); | |
| 72 | + } | |
| 73 | + ?> | |
| 70 | 74 | </a> |
| 71 | 75 | </div> |
| 72 | 76 | <p class="intro"> | ... | ... |
frontend/views/blog/view.php
| ... | ... | @@ -45,11 +45,14 @@ |
| 45 | 45 | <div id="post-content" class="post-blog"> |
| 46 | 46 | |
| 47 | 47 | <p> |
| 48 | - <?= $article->lang->image->getImg( | |
| 49 | - [ | |
| 50 | - 'class' => "img-responsive", | |
| 51 | - ] | |
| 52 | - ) ?> | |
| 48 | + <?php if ($article->lang->image) { | |
| 49 | + echo $article->lang->image->getImg( | |
| 50 | + [ | |
| 51 | + 'class' => "img-responsive", | |
| 52 | + ] | |
| 53 | + ); | |
| 54 | + } | |
| 55 | + ?> | |
| 53 | 56 | </p> |
| 54 | 57 | |
| 55 | 58 | <?= $article->lang->body ?> | ... | ... |