ListView Customization

Hello everyone,

I’d like to customize ListView Widget.

This is how my code look slike:


<?= ListView::widget([

               'dataProvider' => $dataProvider,

               'layout' => '{items}',

               'options' => ['tag' => false],             

               'itemView' => '../product/_list',

]) ?>

             



This piece of code prints:

and after that code written in "_list".

So how could I remove < id="w0">

As you can see there is ‘options’ => [‘tag’ => false], but it’s obviously not enough. The ideal output of:


 <div class="my-items"> 

            

            <?= ListView::widget([

                    'dataProvider' => $dataProvider,

                    'layout' => '{items}',

                    'itemOptions' => ['tag' => 'div'],             

                    'options' => ['tag' => false],             

                    'itemView' => '../product/_list',

            ]) ?>

             

        </div>






Should be:

If you do not need yii features, better is not use ListView,

for example:




foreach ($dataProvider->getModels() as $model) { echo renderPartial('_list',['model'=>$model]); }




Yes. That’s my another solution that was I thinking about. I am just curious if there is a way to solve this with ListView.