Home >Backend Development >PHP Tutorial >PHP example-simple use of Yii2 tab
This article mainly introduces the simple use of Yii2 tab in detail, which has certain reference value. Interested friends can refer to it
The example of this article shares the use of Yii2 tab with everyone. The specific code is for your reference. The specific content is as follows
<!--选项卡开始--> <?php echo \yii\bootstrap\Tabs::widget([ 'id' => 'tabs', 'renderTabContent' => false, //如果是每个选项卡里要显示的是自定义的p或者Render其他页面文件,就设为false. 'linkOptions' => ['data-toggle' => "tab"], 'items' => [ [ 'label' => Yii::t('app', '帐号设置'), 'content' => '', 'headerOptions' => ["id" => 'li_account'], //可设可不设 'url' => '#tab_account', 'active' => true, ], [ 'label' => Yii::t('app', '修改密码'), 'content' => '', 'headerOptions' => ["id" => 'li_password'], 'url' => '#tab_password', 'active' => false, ], [ 'label' => Yii::t('app', '绑定邮箱'), 'content' => '', 'headerOptions' => ["id" => 'li_email'], 'url' => '#tab_email', 'active' => false, ] ] ]) ?> <p class="tab-content"> <!--修改个人信息--> <p class="tab-pane active"id="tab_account"> <!--ID要对应上面的第1个 item 的URL--> 内容.... </p> <!--修改密码--> <p class="tab-pane"id="tab_password"> <!--ID要对应上面的第2个 item 的URL--> 内容.... </p> <!--绑定邮箱--> <p class="tab-pane"id="tab_email"> <!--ID要对应上面的第3个 item 的URL--> 内容.... </p> </p> <!--选项卡结束-->
The above is the detailed content of PHP example-simple use of Yii2 tab. For more information, please follow other related articles on the PHP Chinese website!