Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?= Html::activeCheckboxList($model, 'category', $model->categories, [
- 'item' => function($index, $label, $name, $checked, $value) use ($model) {
- $return = Html::checkbox($name, $checked, [
- 'value' => $value
- ]);
- if(intval($value) === SearchForm::CATEGORY_NEWS) {
- $return .= ' Новости';
- if($model->newsRecords !== null) {
- $return .= PHP_EOL . Html::tag('span', "({$model->newsRecords})");
- }
- } elseif(intval($value) === SearchForm::CATEGORY_ARTICLES) {
- $return .= ' Статьи';
- if($model->articlesRecords !== null) {
- $return .= PHP_EOL . Html::tag('span', "({$model->articlesRecords})");
- }
- }
- return Html::tag('label', $return, ['class' => 'b-form__checkbox']);
- }
- ])?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement