Home > Article > Backend Development > PHP development framework Yii Framework tutorial (17) UI component TabView example
CTabView is used to display paging labels. The basic method of using TabView is to configure the tabs attribute. Each Tab can be configured with the following attributes
title: Label title.
content: Label display content.
view: The label displays the name of the View. If Content is specified at the same time, the Content content is displayed.
url: When the label is clicked, the page is redirected to the specified URL.
data: When the View attribute is specified, the attribute array passed to the View.
This example shows three Each tab page uses different tag content respectively:
beginWidget('CActiveForm'); ?> widget('CTabView',array('activeTab'=>'tab2', 'tabs'=>array('tab1'=>array('title'=>'Static tab','content'=>'Content for tab 1'), 'tab2'=>array('title'=>'Render tab','view'=>'view'), 'tab3'=>array('title'=>'Url tab','url'=>Yii::app()->createUrl("site/url"),)),'htmlOptions'=>array('style'=>'width:500px;'))); ?> endWidget(); ?>
TabView By default, the first page is the current page. You can modify the current page through activeTab. In this example, the second page is also set as the current page. .
The above is the content of the PHP development framework Yii Framework tutorial (17) UI component TabView example. For more related content, please Follow the PHP Chinese website (www.php.cn)!