php - how go to next page in yii2 from listview? -


i having problem on yii2 please how move 1 page in listview that's nothing try seems working. want when listview clicked takes page , carries datas of colon click. next page

this index.php

<?php  use yii\widgets\listview; use yii\data\arraydataprovider; use app\models\myprofile; use app\models\likediscussion; use yii\widgets\activeform; use common\models\topic; use yii\widgets\pjax; use yii\helpers\html; use frontend\assets\appasset;  $this->title = 'my yii application'; ?>            <?php           $query = topic::find()->all();             $dataarr = array();           foreach ($query $detail) {             $dataarr[] = array(                 'topic_id' => $detail->topic_id,                 'topic' => $detail->topic,                 'created' => $detail->created,                 'creator' => $detail->creator,                  'views' => $detail->views             );           }            $dataprovider = new arraydataprovider([                 'allmodels' => $dataarr,                 'pagination' => [                 'pagesize' => 10,                 ],                 'sort' => [                     'attributes' => ['views'=>sort_asc]                 ],             ]); ?>   <?php pjax::begin(['id' => 'countries']) ?>          <?=  listview::widget([              'dataprovider' => $dataprovider,              'itemoptions' => ['class' => 'comment-item'],              'itemview' => 'indexadapter',          ]);             ?> <?php pjax::end() ?> <div class="hr"> </div> 

indexadapter

<?php use yii\helpers\html; use yii\helpers\htmlpurifier;  //var_dump($model);exit; ?>       <div class="gravatar" >                 <img src="images/gravatar.png" alt="" >             </div>             <h5><?php echo $model['topic_id'];             ?>             </h5>             <p>             <h5>             <span class="commentdate">                 <?php echo $model['created']. "by" .$model['creator']; ?>             </span>             </h5>         </p>             <hr> 

try this

 <?= html::a(html::encode($model->topic_id), ['view', 'id' => $model->id]); ?> 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo