yiisoft / yii2-bootstrap4

Yii 2 Bootstrap 4 Extension
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
216 stars 106 forks source link

$headerContent in Doc not existent #222

Closed kasoft closed 2 years ago

kasoft commented 2 years ago

What steps will reproduce the problem?

<?php NavBar::begin([
                'options'=>['class'=>'navbar fixed-top navbar-light'],                                           // <nav class="navbar fixed-top navbar-light">
                'renderInnerContainer'=>true,
                'brandLabel' => 'Text',
                'headerContent' => '<div class="myDiv">Test</div>',
                'innerContainerOptions'=>['class'=>'container-fluid mt-3 navbar-cont'],                         // <div class="container-fluid mt-3 Navbar-Cont">
                'collapseOptions'=>['class'=>'collapsed bg-white', 'id'=>'NavCollap']                           // <div class="collapsed bg-white" id="NavCollap">
            ]);
        ?>

What's expected?

Correct HTML Output

What do you get instead?

Setting unknown property: yii\bootstrap4\NavBar::headerContent

Additional info

Q A
Yii vesion 2.0.45
PHP version 7.4
yiisoft/yii2-bootstrap4 2.0.10
samdark commented 2 years ago

It is not anywhere in docs. Moreover, it's mentioned in migration guide: https://github.com/yiisoft/yii2-bootstrap4/blob/fb559a19ca7ea59d098c796d2a0467683b9f1f9b/docs/guide/migrating-yii2-bootstrap.md#navbar

kasoft commented 2 years ago

Thanks, and sorry, i looked up on bootstrap not bootstrap4. My mistake. https://www.yiiframework.com/extension/yiisoft/yii2-bootstrap/doc/api/2.0/yii-bootstrap-navbar