PHP development framework YiiFramework tutorial (17) UI component TabView example

Source: Internet
Author: User
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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.