vishal shah
vishal shah

Reputation: 316

listview html display in Yii1.1

I am not getting any output html from below code

$this->widget('zii.widgets.CListView', array(
    'id'=>'skills-grid',
    'itemView'=>'scheduled_skills',
    'dataProvider'=>$model->search(),
));

Is there any demo available for listview example in yii1.1? Please share the links for listview example in yii1.1

Upvotes: 0

Views: 1320

Answers (1)

NikuNj Rathod
NikuNj Rathod

Reputation: 1658

You can used this code for ClistView in Yii1.1

Clistview File for ex : index.php

$this->widget('zii.widgets.CListView', array(
    'id'=>'skills-grid',
    'itemView'=>'_scheduled_skills', // Your View file
    'dataProvider'=>$model->search(),
));

ClistView View file for ex : _scheduled_skills.php

<table class="table">
   <tbody>
       <tr>
          <td><span class="title"><strong> First Name</strong> </span></td>
          <td><span class="title"><?php echo $data->first_name;?></td>
        </tr>
       <tr>
          <td><span class="title"><strong>Last Name</strong> </span></td>
          <td><span class="title"><?php echo $data->last_name;?></td>
        </tr>
   </tbody>
</table>

You can direct access $data object in ClistView File.

you can refere this Link Yii1 ClistView

Upvotes: 1

Related Questions