PHP development framework YiiFramework tutorial (17) UI component TabView example
CTabView is used to display Tab pages. The basic way to use TabView is to configure the tabs attribute. the following attributes can be configured for each Tab.
Title: tag question.
Content: the content displayed by the tag.
View: The label displays the View Name. if both the Content is specified, the Content is displayed.
Url: The page is redirected to the specified URL when the tag is clicked.
Data: The attribute array that is passed to the View when the View attribute is specified.
In this example, three tabs are displayed with different tag content:
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 "),
)
),
'Htmlopexception' => array (
'Style' => 'width: 500px ;'
)
);?>
EndWidget ();?>
TabView by default, the first page is the current page. you can use activeTab to modify the current page. In this example, the second page is also set to the current page.