yiisoft / yii2-bootstrap

Yii 2 Bootstrap 3 Extension
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
185 stars 193 forks source link

Collapse: If content is not an array, footer gets ignored #262

Open Commifreak opened 3 years ago

Commifreak commented 3 years ago

What steps will reproduce the problem?

Create a Collapse widget with non-array content and set footer

            $items[] = [
                    'label' =>      'Label',
                    'content' => 'Test',
                    'footer' => 'Footer'
                    ];

What's expected?

Display content as-is along with the specified footer

What do you get instead?

Footer only gets displayed, when content is an array: https://github.com/yiisoft/yii2-bootstrap/blob/master/src/Collapse.php#L227

Additional info

Q A
Yii-Bootstrap vesion 2.0.11
Yii vesion 2.0.43
PHP version 7.4
Operating system Linux
Commifreak commented 3 years ago

The change came with: https://github.com/yiisoft/yii2-bootstrap/commit/599d60c376eaf9dedac0b8b5f48099beabefbe5b - before that, footer seemed unsupported.

Maybe footer could be supported for both variants, regardles of content's type?