How to Count ActiveDataProvider Items

Here’s how to create an ActiveDataProvider in Yii2 and get a count of records: [php] use yii\data\ActiveDataProvider; $participantProvider = new ActiveDataProvider([ ‘query’ => Participant::find()->where([‘meeting_id’=>$id]), ]); echo $participantProvider->getCount(); [/php]

Read More

Dropdown Menus for Navigation Bar

Yii2 uses short array notation extensively. Once you get used to it, it’s great, but it can take a bit of time to read code blocks with it. When arrays are nested, it can be even more confusing. I found the Bootstrap navigation bar layouts to be hard to read. I also couldn’t easily find […]

Read More