Home  >  Article  >  Backend Development  >  PHP development framework Yii Framework tutorial (17) UI component TabView example

PHP development framework Yii Framework tutorial (17) UI component TabView example

黄舟
黄舟Original
2017-01-21 10:27:081014browse

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. .

PHP development framework Yii Framework tutorial (17) UI component TabView example


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)!

Statement:
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