public function pages($options = [])
 {
     return $this->_adp ? LinkPager::widget(array_merge($options, ['pagination' => $this->_adp->pagination])) : '';
 }
Example #2
1
 private function getPager($pages)
 {
     if (self::$_pageLinkPagerOn) {
         return LinkPager::widget(['pagination' => $pages]);
     } else {
         return ['defaultPageSize' => $pages->defaultPageSize, 'forcePageParam' => $pages->forcePageParam, 'limit' => $pages->limit, 'links' => $pages->links, 'offset' => $pages->offset, 'page' => $pages->page, 'pageCount' => $pages->pageCount, 'pageParam' => $pages->pageParam, 'pageSize' => $pages->pageSize, 'pageSizeLimit' => $pages->pageSizeLimit, 'pageSizeParam' => $pages->pageSizeParam, 'params' => $pages->params, 'route' => $pages->route, 'totalCount' => $pages->totalCount, 'urlManager' => $pages->urlManager, 'validatePage' => $pages->validatePage];
     }
 }
Example #3
0
 /**
  * 
  * @return type
  * @throws base\ErrorException
  */
 public function run()
 {
     if (!$this->_filterModel) {
         throw new base\ErrorException('There is no search model');
     }
     $request = Yii::$app->request;
     if ($request->isAjax) {
         Yii::$app->response->format = Response::FORMAT_JSON;
     }
     $data = strtolower($this->requestType) === 'post' && $request->isPost ? $_POST : $_GET;
     $this->_filterModel->load($this->directPopulating ? $data : [$this->_filterModel->formName() => $data]);
     $this->_filterModel->search();
     if ($this->_filterModel->hasErrors()) {
         if ($request->isAjax) {
             return is_callable($this->_validationFailedCallback) ? call_user_func($this->_validationFailedCallback, $this->_filterModel) : ['error' => current($this->_filterModel->getErrors())];
         }
         if (empty($data)) {
             $this->_filterModel->clearErrors();
         }
     }
     if (!($dataProvider = $this->_filterModel->getDataProvider())) {
         throw new base\ErrorException('DataProvider not initialized');
     }
     if ($request->isAjax) {
         return ['list' => $this->_filterModel->buildModels(), 'pagination' => $this->paginationAsHTML ? LinkPager::widget(['pagination' => $dataProvider->getPagination()]) : $dataProvider->getPagination()];
     }
     return $this->controller->render($this->view ?: $this->id, ['filterModel' => $this->_filterModel, 'dataProvider' => $dataProvider, 'requestType' => $this->requestType, 'directPopulating' => $this->directPopulating]);
 }
Example #4
0
 /**
  * Executes the widget.
  *
  * This overrides the parent implementation by initializing jQuery IAS and displaying the generated page buttons.
  *
  * @throws \yii\base\InvalidConfigException
  * @return mixed
  */
 public function run()
 {
     // Initialize jQuery IAS plugin
     $pluginSettings = ['container' => $this->overflowContainer, 'ias' => ['container' => $this->container, 'item' => $this->item, 'pagination' => "{$this->container} .pagination", 'next' => '.next a', 'delay' => $this->delay, 'negativeMargin' => $this->negativeMargin]];
     // Register IAS extensions
     $pluginSettings['extensions'] = $this->registerExtensions([['name' => self::EXTENSION_PAGING], ['name' => self::EXTENSION_SPINNER, 'options' => !empty($this->spinnerSrc) ? ['html' => $this->spinnerTemplate, 'src' => $this->spinnerSrc] : ['html' => $this->spinnerTemplate]], ['name' => self::EXTENSION_TRIGGER, 'options' => ['text' => $this->triggerText, 'html' => $this->triggerTemplate, 'offset' => $this->triggerOffset]], ['name' => self::EXTENSION_NONE_LEFT, 'options' => ['text' => $this->noneLeftText, 'html' => $this->noneLeftTemplate]], ['name' => self::EXTENSION_HISTORY, 'options' => ['prev' => $this->historyPrev], 'depends' => [self::EXTENSION_TRIGGER, self::EXTENSION_PAGING]]]);
     // Register event handlers
     $pluginSettings['events'] = $this->registerEventHandlers(['scroll' => [], 'load' => [], 'loaded' => [], 'render' => [], 'rendered' => [], 'noneLeft' => [], 'next' => [], 'ready' => [], 'pageChange' => [self::EXTENSION_PAGING]]);
     // Render pagination links
     return LinkPager::widget(['pagination' => $this->pagination, 'options' => ['class' => 'pagination hidden', 'role' => 'iasContainer', 'data-ias' => json_encode($pluginSettings)]]);
 }
 public function actionUploadDict()
 {
     $sougouDir = Yii::$app->params['sougouDictDir'];
     $dictFiles = array();
     if (file_exists($sougouDir)) {
         if (is_writable($sougouDir)) {
             $oDir = dir($sougouDir);
             while (($file = $oDir->read()) !== false) {
                 if (strcasecmp($file, '.') != 0 && strcasecmp($file, '..') != 0) {
                     $filename = $sougouDir . '/' . $file;
                     if (is_dir($filename)) {
                         $subDir = dir($filename);
                         while (($subFile = $subDir->read()) !== false) {
                             if (strcasecmp($subFile, '.') != 0 && strcasecmp($subFile, '..') != 0) {
                                 $dictFiles[$file][] = $subFile;
                             }
                         }
                     }
                 }
             }
         } else {
             exit('目录不可写');
         }
     }
     $count = count($dictFiles);
     $page = isset($_REQUEST['page']) ? $_REQUEST['page'] ? $_REQUEST['page'] : 1 : 1;
     $pageSize = 10;
     $start = ($page - 1) * $pageSize;
     $pager = new \yii\data\Pagination(array('defaultPageSize' => $pageSize, 'totalCount' => $count));
     if ($page > $pager->getPageCount() && $page != 1) {
         exit('超过最大页数');
     }
     $data = array();
     if ($count) {
         $sArr = array_slice($dictFiles, $start, $pageSize, true);
         foreach ($sArr as $time => $value) {
             if (!empty($value)) {
                 foreach ($value as $key => $val) {
                     if (preg_match('/\\.scel/', $val)) {
                         $file = $sougouDir . '/' . $time . '/' . $val;
                         $data[$time][$key] = array('filename' => mb_convert_encoding($val, 'UTF-8', 'GBK,GB2312'), 'filesize' => \app\common\XUtils::file_size_format(filesize($file)), 'filetype' => filetype($file), 'filetime' => date('Y-m-d H:i:s', filemtime($file)));
                     }
                 }
             }
         }
     }
     if (Yii::$app->request->isPost) {
         exit(json_encode(array('data' => $data, 'pager' => \yii\widgets\LinkPager::widget(['pagination' => $pager, 'prevPageLabel' => '上一页', 'nextPageLabel' => '下一页']))));
     }
     return $this->render('uploaddict', array('data' => $data, 'pager' => $pager));
 }
Example #6
0
 public function testFirstLastPageLabels()
 {
     $pagination = new Pagination();
     $pagination->setPage(5);
     $pagination->totalCount = 500;
     $pagination->route = 'test';
     $output = LinkPager::widget(['pagination' => $pagination, 'firstPageLabel' => true, 'lastPageLabel' => true]);
     static::assertContains('<li class="first"><a href="/?r=test&amp;page=1" data-page="0">1</a></li>', $output);
     static::assertContains('<li class="last"><a href="/?r=test&amp;page=25" data-page="24">25</a></li>', $output);
     $output = LinkPager::widget(['pagination' => $pagination, 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last']);
     static::assertContains('<li class="first"><a href="/?r=test&amp;page=1" data-page="0">First</a></li>', $output);
     static::assertContains('<li class="last"><a href="/?r=test&amp;page=25" data-page="24">Last</a></li>', $output);
     $output = LinkPager::widget(['pagination' => $pagination, 'firstPageLabel' => false, 'lastPageLabel' => false]);
     static::assertNotContains('<li class="first">', $output);
     static::assertNotContains('<li class="last">', $output);
 }
 /**
  * 用户列表
  * @return [type] [description]
  */
 public function actionIndex()
 {
     $model = new \app\models\WAdmin();
     $currentPage = $this->_getPost('page') ? $this->_getPost('page') : 1;
     $pageSize = $this->_getPost('pageSize') ? $this->_getPost('pageSize') : 10;
     $where = 1;
     if ($this->_getPost('searchName')) {
         $where = $this->buildQuery(['username' => $this->_getPost('searchName')], 'and');
     }
     $data = $model->getAdminList(($currentPage - 1) * $pageSize, $pageSize, $where);
     foreach ($data['data'] as $key => $value) {
         $data['data'][$key]['last_login_time'] = date('Y-m-d H:i:s', $value['last_login_time']);
     }
     $pager = new \yii\data\Pagination(array('defaultPageSize' => $pageSize, 'totalCount' => $data['count']['n']));
     if (\Yii::$app->request->isGet) {
         return $this->render('index', array('datalist' => $data['data'], 'pager' => $pager));
     } else {
         exit(json_encode(array('datalist' => $data['data'], 'pager' => \yii\widgets\LinkPager::widget(['pagination' => $pager, 'prevPageLabel' => '上一页', 'nextPageLabel' => '下一页']))));
     }
 }
Example #8
0
 public function run()
 {
     if (!$this->_filterModel) {
         throw new base\ErrorException('Не указана модель поиска');
     }
     $request = Yii::$app->request;
     if ($request->isAjax) {
         Yii::$app->response->format = Response::FORMAT_JSON;
     }
     // Проставляем данные
     $data = strtolower($this->requestType) === 'post' && $request->isPost ? $_POST : $_GET;
     $this->_filterModel->load($this->directPopulating ? $data : [$this->_filterModel->formName() => $data]);
     // Производим выборку в модели поиска
     $this->_filterModel->search();
     // Если при поиске произошла ошибка валидации
     if ($this->_filterModel->hasErrors()) {
         /**
          * В зависимости от запроса решаем что делать,
          * если ajax то сбрасываем ошибку, иначе если входящих данных нет, очищаем ошибки
          */
         if ($request->isAjax) {
             return is_callable($this->_validationFailedCallback) ? call_user_func($this->_validationFailedCallback, $this->_filterModel) : ['error' => current($this->_filterModel->getErrors())];
         }
         if (empty($data)) {
             $this->_filterModel->clearErrors();
         }
     }
     if (!($dataProvider = $this->_filterModel->getDataProvider())) {
         throw new base\ErrorException('Не проинициализирован DataProvider');
     }
     if ($request->isAjax) {
         // Возвращаем корректно сформированную коллекцию объектов
         return ['list' => $this->_filterModel->buildModels(), 'pagination' => $this->paginationAsHTML ? LinkPager::widget(['pagination' => $dataProvider->getPagination()]) : $dataProvider->getPagination()];
     }
     return $this->controller->render($this->view ?: $this->id, ['filterModel' => $this->_filterModel, 'dataProvider' => $dataProvider, 'requestType' => $this->requestType, 'directPopulating' => $this->directPopulating]);
 }
Example #9
0
                        <p class="entry-summary">
                            <?php 
        echo $post->post_excerpt;
        ?>
...
                        </p>
                        <footer class="footer-meta">
                            <h3>
                                <?php 
        $tags = $post->getTerms()->innerJoinWith(['taxonomy'])->andWhere(['taxonomy_slug' => 'tag'])->all();
        foreach ($tags as $tag) {
            echo Html::a($tag->term_name, $tag->url, ['class' => 'badge']) . "\n";
        }
        ?>
                            </h3>
                        </footer>
                    </div>
                </div>
            </article>
        <?php 
    }
    ?>
        <nav id="archive-pagination">
            <?php 
    echo LinkPager::widget(['pagination' => $pages, 'activePageCssClass' => 'active', 'disabledPageCssClass' => 'disabled', 'options' => ['class' => 'pagination']]);
    ?>
        </nav>
    <?php 
}
?>
</div>
Example #10
0
                            class="comment-total"> · <?php 
    echo $article['comment_total'] > 0 ? '已经有' . $article['comment_total'] . '个用户发表了读后感' : '还没人鸟我哟';
    ?>
</span>
                    </section>
                    <div class="article-content">
                        <?php 
    echo \yii\helpers\StringHelper::truncateWords($parsedown->parse($article['text']), 10);
    ?>
                    </div>
                </article>
            <?php 
}
?>
            <?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $articles['pagination']]);
?>
        </div>
        <div class="hidden-xs col-md-3 col-lg-4">
            <div class="panel panel-default">
                <div class="panel-heading">分类简介</div>
                <div class="panel-body"><?php 
echo $category['description'] ?: '唔,这个分类的介绍被搞丢了。。。';
?>
</div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">分类热门</div>
                <div class="list-group">
                    <?php 
foreach ($hotArticles['data'] as $article) {
Example #11
0
                    <td><?php 
    echo $model->stateName;
    ?>
</td>
                    <td><?php 
    echo $model->replyUser['nickname'];
    ?>
</td>
                    <td><?php 
    echo $model->replyContent;
    ?>
</td>
                    <td><?php 
    echo $model->replyDate;
    ?>
</td>
                </tr>
            <?php 
}
?>
            </tbody>
        </table>
        <nav class="pull-right pagination_footer">
            <?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $pages]);
?>
        </nav>
        <div class="clearfix"></div>
    </div>
</div>
Example #12
0
 public function api_pages()
 {
     return $this->_adp ? LinkPager::widget(['pagination' => $this->_adp->pagination]) : '';
 }
Example #13
0
                            <div class="tour-info fl">
                                <img src="<?php 
    echo $this->theme->getUrl('assets/img/calendar_icon_grey.png');
    ?>
" alt="">
                                <span class="font-style-2 color-dark-2"><?php 
    echo date('d.m.y', strtotime($model->dateCreate));
    ?>
</span>
                            </div>
                        </div>
                        <br>
                        <a href="<?php 
    echo $model->oneUrl;
    ?>
" class="c-button small bg-dr-blue-2 hv-dr-blue-2-o"><span>Подробнее</span></a>
                    </div>
                </div>
            </div>
            <?php 
}
?>
        </div>
        <div class="c_pagination clearfix">
            <?php 
echo LinkPager::widget(['pagination' => $pagination, 'options' => ['class' => 'cp_content color-3']]);
?>
        </div>
    </div>
</div>
Example #14
0
        ?>
                            </td>
                        </tr>
                        <?php 
    }
}
?>
                        </tbody>
                    </table>
                    

                </div>

                    <div class="mail-body text-right tooltip-demo">
                       <?php 
echo LinkPager::widget(['pagination' => $pagination, 'firstPageLabel' => "First", 'prevPageLabel' => 'Prev', 'nextPageLabel' => 'Next', 'lastPageLabel' => 'Last']);
?>
                    </div>
                    <div class="clearfix"></div>
                </div>

            </div>
        </div>
        </div>
<!--模态框->添加菜单-->
<div class="modal inmodal fade" id="myModa" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
Example #15
0
<?php

use yii\widgets\LinkPager;
echo date("Y-m-d", $firstDay);
?>

<?php 
foreach ($materials as $material) {
    ?>

<?php 
    echo $material->title;
    ?>
</br>
<?php 
}
?>

<?php 
echo LinkPager::widget(['pagination' => $pages, 'registerLinkTags' => true]);
Example #16
0
<?php

/**
 * @var $dataProvider \yii\data\ActiveDataProvider
 */
use yii\widgets\LinkPager;
?>

<div class="row">
    <?php 
echo $dataProvider->pagination->totalCount > $dataProvider->pagination->pageSize ? LinkPager::widget(['pagination' => $dataProvider->pagination]) : '';
?>
</div>
Example #17
0
                        <?php 
foreach ($countries as $k => $v) {
    echo '<tr>';
    echo '<td>' . ($k + 1) . '</td>';
    echo '<td>' . Tool::echoEncodeString($v->employName) . '</td>';
    echo '<td>' . GlobalArray::$employStatusArr[Tool::echoEncodeString($v->status, 0)] . '</td>';
    echo '<td>' . Tool::echoEncodeString($v->count) . '</td>';
    echo '<td>' . GlobalArray::$employGroupArr[Tool::echoEncodeString($v->group, '0')] . '</td>';
    echo '<td>' . GlobalArray::$employTypeArr[Tool::echoEncodeString($v->type, '0')] . '</td>';
    echo ' <td>' . Tool::echoEncodeString($v->money) . '</td>';
    echo '<td>' . Tool::echoEncodeString($v->address) . '</td>';
    echo '<td><a href="' . Yii::$app->urlManager->createUrl([\common\widgets\Variable::$editEmploy_url, 'id' => Tool::echoEncodeString($v->id)]) . '">编辑</a><a onclick="deleteEmploy(this,' . Tool::echoEncodeString($v->id) . ')">删除</a></td>';
    echo '</tr>';
}
?>

                    </table>
                </div>
            </div>



<!--            <embed src="http://player.youku.com/player.php/Type/Folder/Fid/16980025/Ob/1/Pt/0/sid/XMzQ3Njg5MTAw/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" allowFullScreen="true" mode="transparent" type="application/x-shockwave-flash"></embed>-->

            <?php 
echo LinkPager::widget(['pagination' => $pagination, 'nextPageLabel' => '下一页', 'prevPageLabel' => '上一页', 'firstPageLabel' => '首页', 'lastPageLabel' => '末页']);
?>
        </div>
    </div>
</div>
Example #18
0
<br/>
                                领取时间:<?php 
        echo $onelog->showFittimeRemark(1);
        ?>
 <br/>
                            </p>
                        </div>
                    </div>
                </div>
                <?php 
    }
    ?>
        </div>
        <div class="text-center">
            <?php 
    echo LinkPager::widget(['pagination' => $accountlogs['pages']]);
    ?>
        </div>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.deploy-toggle-1').on('click', function() {
                    $(this).parent().find('.toggle-content').toggle(100);
                    $(this).toggleClass('toggle-1-active');
                    return false;
                });
            });
        </script>
        <?php 
    Pjax::end();
    ?>
    <?php 
<!--				             		</div>-->
<!--				             		<div>日照名坡绿茶</div>-->
<!--				             		<div>300包</div>-->
<!--				             		<div>¥2981111.00</div>-->
<!--			             		</div>-->
<!--			             		<div class="sub-row">-->
<!--			             			<div>-->
<!--				             			<img src="/img/index_11.png" class="img-responsive" />-->
<!--				             		</div>-->
<!--				             		<div>日照名坡绿茶</div>-->
<!--				             		<div>300包</div>-->
<!--				             		<div>¥2981111.00</div>-->
<!--			             		</div>			             		-->
<!--			             	</div>-->
<!--			             	<div>¥298.00</div>-->
<!--			             	<div>刘玲玲</div>-->
<!--			             	<div class="sub-con-details">已取消<a href="">订单详情</a></div>-->
<!--			             	<div class="sub-con-last">-->
<!--			             		<a href="">立即购买</a>-->
<!--			             	</div>-->
<!--			             </div>-->
<!--			          </li>-->
<!--			       </ul>-->
			    </div>
				<?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $pagination, 'nextPageLabel' => '下一页', 'prevPageLabel' => '上一页', 'firstPageLabel' => '首页', 'lastPageLabel' => '末页', 'options' => ['class' => 'orderPage']]);
?>
			</div>
		</div>
	</div>
Example #20
0
?>
            </div>
        </div>
        <div class="content">
            <ul class="glavnaia">
                <?php 
foreach ($items as $item) {
    echo $this->render('_serviceCard', ['model' => $item]);
}
?>
            </ul>

            <div class="page_schet">

                <?php 
echo LinkPager::widget(['pagination' => $pages, 'prevPageCssClass' => 'pager-previo', 'lastPageCssClass' => 'last', 'nextPageCssClass' => 'pager-next']);
?>
            </div>
            <div class="map_vk">
                <div class="map_bg">
                    <?php 
echo \app\modules\cms\components\yandexMap\Map::widget(['points' => \app\modules\discount\models\Partner::getMapPoints()]);
?>
                </div>
                <div class="vk">
                    <script type="text/javascript" src="//vk.com/js/api/openapi.js?116"></script>

                    <!-- VK Widget -->
                    <div id="vk_groups"></div>
                    <script type="text/javascript">
                        VK.Widgets.Group("vk_groups", {mode: 0, width: "220", height: "400", color1: 'FFFFFF', color2: '2B587A', color3: '5B7FA6'}, 95056247);
Example #21
0
    if ($i != 0 && $i % 3 == 0) {
        ?>
            </div><div class="row">
                <?php 
    }
    ?>
                <div class="col-lg-4">
                    <div class="thumbnail">
                        <?php 
    echo HTML::a(Yii::$app->imageCache->thumb($node->image, 'post', ['class' => 'img-responsive']), ['product/view', 'slug' => $node->slug]);
    ?>
                    </div>
                    <h5 class="grid-product-title"><?php 
    echo HTML::a($node->title, ['product/view', 'slug' => $node->slug]);
    ?>
</h5>
                </div>
                <?php 
    $i++;
}
?>
            </div>
        </div>
        <div class="pagi">
            <?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $pagination, 'options' => ['class' => 'pagination small']]);
?>
        </div>
    </div>
</div>
Example #22
0
                                    </div>
                                </div>
                            </div> <!-- /.project-item -->
                            <?php 
}
?>

                        </div> <!-- /.row -->


                        <div class="load-more">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="pagination text-center">
                                    <?php 
echo LinkPager::widget(['pagination' => $pages, 'options' => ['class' => 'pagerBox'], 'disabledPageCssClass' => '', 'activePageCssClass' => 'active', 'firstPageLabel' => '<<', 'nextPageLabel' => '>', 'prevPageLabel' => '<', 'maxButtonCount' => 5]);
?>
                                    </div> <!-- /.pagination -->
                                </div> <!-- /.col-md-12 -->
                            </div> <!-- /.row -->

                            <!-- 
                            <a href="javascript:void(0)" class="load-more">Load More</a>
                            -->
                        </div>
                    </div> <!-- /.projects-holder -->
                </div> <!-- /.projects-holder-2 -->
            </div> <!-- /.inner-content -->
        </div> <!-- /.content-wrapper -->

Example #23
0
                                            <div class="error-actions">
                                                <a href="<?php 
    echo \yii\helpers\Url::to(['/site/index']);
    ?>
" class="btn btn-lg btn-orange tooltip-test mainserarchsubmit"><span class="glyphicon glyphicon-home"></span>
                                                    Take Me Home </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php 
}
?>

                        <!-- Paging-->
                        <div class="mt30 clearfix">
                            <?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $dataProvider->pagination]);
?>
                            ?>
                        </div>
                    </div>


                </div>
            </div>

        </div>
    </div>
</div>
Example #24
0
    public function actionTi_sousuo()
    {
        $id = $_GET['id'];
        //echo $pid;
        $arr = Intelligenttest::find()->where(['leave' => 1])->all();
        $query = Ti::find()->where(['pid' => $id]);
        //var_dump($query);die;
        $pagination = new Pagination(['defaultPageSize' => 5, 'totalCount' => $query->count()]);
        $row = $query->where(['pid' => $id])->asArray()->offset($pagination->offset)->limit($pagination->limit)->all();
        $str = '<table class="table table-striped table-bordered table-hover" id="sample_1">
							<thead>
							<tr>
								<th class="table-checkbox">
									<input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
								</th>
								<th>
									 ID
								</th>
								<th>
									 题目名称
								</th>
                                                                <th>
									 题目类型
								</th>
                                                                <th>
									 题目选项
								</th>
                                                                <th>
									 正确答案
								</th>
								<th>
									 父分类
								</th>
								<th>
									 操作
								</th>
							</tr>
							</thead>
							 <tbody>';
        foreach ($row as $v) {
            $str .= '<tr class="odd gradeX">
								<td>
									<input type="checkbox" class="checkboxes" value="1"/>
								</td>
								<td>
									 ' . $v['_id'] . '
								</td>
								<td width="410">
									<a href="mailto:shuxer@gmail.com">
										 ' . $v['question'] . '
									</a>
								</td>
                                                                <td>
									 ' . $v['type'] . '
								</td>
                                                                <td width="200">
									 ' . $v['all_answer'] . '
								</td>
                                                                <td>
									 ' . $v['really_answer'] . '
								</td>
                                                                <td>
                                                                    ';
            foreach ($arr as $vv) {
                if ($v['pid'] == $vv['_id']) {
                    $str .= $vv['title'];
                }
            }
            $str .= '
								</td>
								<td>
									<span>
                                                                            <a href="#" class="label label-sm label-success">删除</a> 
									</span>
									<span class="label label-sm label-success">
										 修改
									</span>
								</td>
							</tr>';
        }
        $str .= "</tbody>\n\t\t\t\t\t\t\t</table>";
        $page = LinkPager::widget(['pagination' => $pagination]);
        if (@$_GET['page']) {
            return $this->renderPartial('ti_list', ['data' => $row, 'pagination' => $pagination, 'arr' => $arr]);
        } else {
            echo json_encode(['page' => $page, 'content' => $str]);
        }
    }
Example #25
0
if (!$pagination && strlen($postsHtml) > 0) {
    $postsUrl = Url::toRoute(['/$basePath']);
    if (Yii::$app->cmgCore->multiSite && Yii::$app->cmgCore->subDirectory) {
        $siteName = Yii::$app->cmgCore->getSiteName();
        $postsUrl = Url::toRoute(["/{$siteName}/{$basePath}"]);
    }
    ?>
	<div class="post-all">
		<a href="<?php 
    echo $postsUrl;
    ?>
">View All</a>
	</div>
<?php 
} else {
    if (strlen($postsHtml) <= 0) {
        ?>
	<p>No posts found.</p>
<?php 
    }
}
?>

<?php 
if ($pagination && strlen($postsHtml) > 0 && isset($dataProvider)) {
    $pagination = $dataProvider->getPagination();
    $pageInfo = CodeGenUtil::getPaginationDetail($dataProvider);
    $pageLinks = LinkPager::widget(['pagination' => $pagination]);
    $pagination = "<div class='wrap-pagination clearfix'>\n\t\t\t\t\t\t<div class='info'>{$pageInfo}</div>\n\t\t\t\t\t\t{$pageLinks}\n\t\t\t\t   </div>";
    echo $pagination;
}
Example #26
0
    foreach ($data['models'] as $key => $val) {
        ?>
                            <li><a href="<?php 
        echo \yii\helpers\Url::to(['/news/view/', 'id' => $val['id']]);
        ?>
""><?php 
        echo $val['title'];
        ?>
</a><span><?php 
        echo date('Y-m-d', strtotime($val['create_time']));
        ?>
</span></li>
                        <?php 
    }
    ?>
                    <?php 
}
?>
                </ul>
                <!--number-->
                <div class="number_box">
                    <?php 
echo \yii\widgets\LinkPager::widget(['pagination' => $data['pages']]);
?>
                </div>
                <!--number-->
            </div>
        </div>
    </div>
</div>
<!--content-->
Example #27
0
                    <br>

                    地点:<?php 
    echo $item->place;
    ?>
                    
                    <br>

                    活动概要:<?php 
    echo $item->summary;
    ?>
                    
                    <span class="badge pull-right">提交时间:<?php 
    echo $item->created_at;
    ?>
</span>

                </p>
            </a>
<?php 
}
?>
        </div>
        <?php 
echo LinkPager::widget(['pagination' => $noreply_page]);
?>
    </div>
</div>

</div>
Example #28
0
        </div>
        <!-- gallery -->

<!--        <div class="c-c pagination">-->
<!--            <ul class="unstyled inline">-->
<!--                <li class="button inactive"><a href="#">&lt;&lt;</a></li>-->
<!--                <li class="button inactive"><a href="#">&lt;</a></li>-->
<!--                <li class="button current"><a href="#">1</a></li>-->
<!--                <li class="button"><a href="#">2</a></li>-->
<!--                <li class="button"><a href="#">3</a></li>-->
<!--                <li class="button"><a href="#">4</a></li>-->
<!--                <li class="button"><a href="#">5</a></li>-->
<!--                <li class="button"><a href="#">&gt;</a></li>-->
<!--                <li class="button"><a href="#">&gt;&gt;</a></li>-->
<!--            </ul>-->
<!--        </div>-->

            <div class="c-c pagination">
                <?php 
// отображаем постраничную разбивку
echo LinkPager::widget(['pagination' => $pages, 'options' => ['class' => 'unstyled inline'], 'activePageCssClass' => 'button current', 'disabledPageCssClass' => 'button', 'firstPageCssClass' => 'button', 'lastPageCssClass' => 'button', 'prevPageCssClass' => 'button']);
?>
            </div>



    </div>

    <!-- intro text -->

</div>
Example #29
0
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Post', ['create'], ['class' => 'btn btn-success']);
?>
    </p>


    <?php 
/* echo ListView::widget([
       'dataProvider' => $dataProvider,
       'itemView' => '_post',
   ]);*/
//die(print_r($posts));
foreach ($posts as $post) {
    echo $this->render('_post', ['model' => $post]);
}
?>
    <div>
    <?php 
echo LinkPager::widget(['pagination' => $pages]);
?>
    </div>

</div>
Example #30
0
            $url['p'] = $gotopage;
        }
        echo '<div class="item-commentcount">', Html::a($topic['comment_count'], $url, ['class' => 'count_livid']), '</div>';
    }
    echo Html::a(Html::encode($topic['node']['name']), ['topic/node', 'name' => $topic['node']['ename']], ['class' => 'node']), '  •  <strong>', Html::a(Html::encode($topic['author']['username']), ['user/view', 'username' => Html::encode($topic['author']['username'])]), '</strong>', ' •  ', Yii::$app->formatter->asRelativeTime($topic['replied_at']);
    if ($topic['comment_count'] > 0) {
        echo '<span class="item-lastreply"> •  最后回复者 ', Html::a(Html::encode($topic['lastReply']['username']), ['user/view', 'username' => Html::encode($topic['lastReply']['username'])]), '</span>';
    }
    echo '</div>
				</div>';
    echo '</div>';
}
?>
	<div class="item-pagination">
	<?php 
echo LinkPager::widget(['pagination' => $pages, 'maxButtonCount' => 5]);
?>
	</div>

</div>

</div>
<!-- sf-left end -->

<!-- sf-right start -->
<div class="col-md-4 sf-right">
<?php 
echo $this->render('@app/views/common/_right');
?>
</div>
<!-- sf-right end -->