?> " alt="<?php echo $row['title']; ?> " class="wp-post-image" width="630" height="120" style="height:120px;" /></a> </div> <?php } ?> <span class="note"> <?php if (!empty($row['thumb'])) { ?> <?php echo StringHelper::subString($row['summary'], 90); ?> …… <?php } else { ?> <?php echo $row['summary']; ?> …… <?php } ?> </span> <p class="auth-span"> <span class="muted"><i class="fa fa-clock-o"></i><?php
public function getSummary($model, $bodyModel) { if (empty($model->summary)) { if ($bodyModel->hasAttribute('body')) { $content = strip_tags($bodyModel->body); $content = preg_replace('/\\s/', '', $content); $model->summary = StringHelper::subString($content, 250); } } return $model->summary; }