Exemple #1
0
?>
 </p>
            <hr>

            <?php 
$images = ContentHelper::fetchImages($model->text);
if ($images['count']) {
    $carousel = CarouselWidget::widget(['template' => 'single', 'mode' => 'images', 'slides' => $images['images']]);
    echo '<div class="col-lg-12">' . $carousel . '</div>';
    $this->registerMetaTag(['property' => 'og:image', 'content' => url::toRoute($images['main']['src'], true)]);
}
?>

            <div class="col-lg-12">
                <?php 
echo ContentHelper::cleanImages($model->text);
?>
            </div>

        </div>
        <div class="col-md-4">
            <!-- Blog Search Well -->
            <!--            <div class="well">-->
            <!--                <h4>Search</h4>-->
            <!--                <div class="input-group">-->
            <!--                    <input type="text" class="form-control">-->
            <!--                    <span class="input-group-btn">-->
            <!--                            <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>-->
            <!--                        </span>-->
            <!--                </div>-->
            <!--            </div>-->
Exemple #2
0
                    <a href="/">Додому</a>
                </li>
                <li class="active">Лента</li>
            </ol>
        </div>
    </div>
    <!-- /.row -->
    <?php 
$model = new Content();
//    $items = $model->bySection(5, $perPage);
$lenghtLimit = 720;
$out = '';
if (!empty($models)) {
    foreach ($models as $item) {
        $images = ContentHelper::fetchImages($item['text']);
        $cleanContent = ContentHelper::cleanImages($item['text']);
        $header = '<h3><a href="/info/' . $item['slug'] . '" > ' . $item['name'] . '</a></h3>';
        $buttonMore = '';
        if (strlen($cleanContent) >= $lenghtLimit) {
            $buttonMore = '<a class="btn btn-info" href="/events/' . $item['slug'] . '"    style="float:right;" ><i>Докладніше</i></a>';
            $cleanContent = BaseStringHelper::truncate(strip_tags($cleanContent), $lenghtLimit, "...");
        }
        $content = '<p>' . $cleanContent . '</p>';
        if (!$images['count']) {
            $item = '<div class="col-md-12">' . $header . $content . $buttonMore . '</div>';
        } else {
            $item = '<div class="col-md-5"><a href="/info/' . $item['slug'] . '">
                    <img class="img-responsive img-hover" src="' . $images['main']['src'] . '" alt="' . $images['main']['alt'] . '">
                    </a></div><div class="col-md-7">' . $header . $content . $buttonMore . '</div>';
        }
        $out .= '<div class="row">' . $item . '</div><hr>';