Home > Backend Development > PHP Tutorial > PHP example-simple use of Yii2 tab

PHP example-simple use of Yii2 tab

微波
Release: 2023-03-11 18:44:01
Original
1094 people have browsed it

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([
&#39;id&#39; => &#39;tabs&#39;,
&#39;renderTabContent&#39; => false, //如果是每个选项卡里要显示的是自定义的p或者Render其他页面文件,就设为false.
&#39;linkOptions&#39; => [&#39;data-toggle&#39; => "tab"],
&#39;items&#39; => [
    [
&#39;label&#39; => Yii::t(&#39;app&#39;, &#39;帐号设置&#39;),
&#39;content&#39; => &#39;&#39;,
&#39;headerOptions&#39; => ["id" => &#39;li_account&#39;], //可设可不设
&#39;url&#39; => &#39;#tab_account&#39;,
&#39;active&#39; => true,
    ],
    [
&#39;label&#39; => Yii::t(&#39;app&#39;, &#39;修改密码&#39;),
&#39;content&#39; => &#39;&#39;,
&#39;headerOptions&#39; => ["id" => &#39;li_password&#39;],
&#39;url&#39; => &#39;#tab_password&#39;,
&#39;active&#39; => false,
    ],
    [
&#39;label&#39; => Yii::t(&#39;app&#39;, &#39;绑定邮箱&#39;),
&#39;content&#39; => &#39;&#39;,
&#39;headerOptions&#39; => ["id" => &#39;li_email&#39;],
&#39;url&#39; => &#39;#tab_email&#39;,
&#39;active&#39; => 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>

<!--选项卡结束-->
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template