hey talk me through how I could make bootstrap 4.6 carousel work with yii2 post::find…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
hey talk me through how I could make bootstrap 4.6 carousel work with yii2 post::find loop... I have everything working from the post side, but getting a array from post that is tailored for the carousel widget is giving me problems. right now I was thinking of doing a simple foreach loop "dataNews as value) { results['items']['content'] = ''; value['title'] . '' . results['options'] = $value['title']; }" so it would work with the carousel that is setup as such "Carousel::widget([ 'items' => [ [ 'content' => '', 'caption' => 'This is titleThis is the caption text', //'options' => [...], ], [ //'content' => '', //'caption' => 'This is titleThis is the caption text', //'options' => [...], ], ], ]);"
- Assistant
To make Bootstrap 4.6 Carousel work with a Yii2
Post::findloop, you need to correctly populate theitemsarray with the content of your posts. Your loop looks reasonable, but there seems to be a small issue with how you're appending items to the array.