Example #1
0
 public function actionMoreNews()
 {
     $page = Yii::$app->request->get('page');
     $default_offset = 2;
     $limit = 2;
     $offset = $default_offset + $page * $limit;
     $count = NewsQuery::getNewsesAndProjectsCount();
     //var_dump($offset, $count); exit;
     if ($offset >= $count['count'] - 1) {
         $array = array('status' => 2);
     } else {
         $newses = NewsQuery::getNewsesAndProjects($offset, $limit);
         $html = Helper::ShowNews($newses);
         $array = array('status' => 1, 'html' => $html);
     }
     echo Json::encode($array);
 }
Example #2
0
}
?>
                </div>    
                <div>
                    <?php 
if (!empty($project->attachment)) {
    $attachments = json_decode($project->attachment);
    foreach ($attachments as $attachment) {
        ?>
                        <a class="btn" href="<?php 
        echo Yii::$app->params['uploadUrl'] . 'files/' . $attachment;
        ?>
"><?php 
        echo Yii::t('app', 'Read more');
        ?>
</a>
                    <?php 
    }
}
?>
                </div>       
        </div>

        <div class="row">
            <?php 
echo Helper::showProjects($other_projects);
?>
       
        </div>
    </div>
</div>           
Example #3
0
    }
}
?>
                </div>    
                <div>
                    <?php 
if (!empty($news->attachment)) {
    $attachments = json_decode($news->attachment);
    foreach ($attachments as $attachment) {
        ?>
                        <a class="btn" href="<?php 
        echo Yii::$app->params['uploadUrl'] . 'files/' . $attachment;
        ?>
"><?php 
        echo Yii::t('app', 'Read more');
        ?>
</a>
                    <?php 
    }
}
?>
                </div>       
        </div>

        <div class="row">
            <?php 
echo Helper::showNews($other_news);
?>
        </div>
    </div>
</div>           
Example #4
0
        </div>
    </div>
<section>   
<section>
    <div class="container">
        <div class="row">
            <div class="col-md-12 text-center">
                <h2 class="page-title"><?php 
echo Yii::t('app', 'news');
?>
</h2>
            </div>
        </div>
        <div class="row" id="prew">
            <?php 
echo Helper::showNewsAndProjects($newses);
?>
        </div>
        <div class="row text-center">
            <button class="btn more" id="more_news" data-page="0"><?php 
echo Yii::t('app', 'load more');
?>
</button>
        </div>
    </div>
</section>      
<script type="text/javascript">
    var a = document.body;
    if (a.classList) {
        a.classList.add('news-page');
    } else {
Example #5
0
<?php

/* @var $this yii\web\View */
use yii\widgets\LinkPager;
use frontend\helpers\Helper;
$language = Yii::$app->language;
$this->title = Yii::t('app', 'projects');
?>
<section>
    <div class="container">
        <div class="row">
            <div class="col-md-12 text-center">
                <h2 class="page-title"><?php 
echo Yii::t('app', 'projects');
?>
</h2>
            </div>
        </div>
        <div class="row">
           <?php 
echo Helper::showProjects($projects);
?>
        </div>
         <?php 
echo LinkPager::widget(['pagination' => $pages]);
?>
    </div>
</section>