Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionActiveForm
  • ActionActiveFormBase
  • CActiveForm
  • CalendarEventActiveForm
  • CallActiveForm
  • CClipWidget
  • CContentDecorator
  • CFilterWidget
  • CFlexWidget
  • CHtmlPurifier
  • CInputWidget
  • CMarkdown
  • CMaskedTextField
  • CMultiFileUpload
  • COutputCache
  • COutputProcessor
  • CStarRating
  • CTabView
  • CTextHighlighter
  • CTreeView
  • CWidget
  • EventActiveForm
  • MobileActiveForm
  • NoteActiveForm
  • TimeActiveForm
  • X2ActiveForm
  • X2StarRating
  • Overview
  • Package
  • Class
  • Tree

Class CTabView

CTabView displays contents in multiple tabs.

At any time, only one tab is visible. Users can click on the tab header to switch to see another tab of content.

JavaScript is used to control the tab switching. If JavaScript is disabled, CTabView still manages to display the content in a semantically appropriate way.

To specify contents and their tab structure, configure the CTabView::$tabs property. The CTabView::$tabs property takes an array with tab ID being mapped tab definition. Each tab definition is an array of the following structure:
  • title: the tab title.
  • content: the content to be displayed in the tab.
  • view: the name of the view to be displayed in this tab. The view will be rendered using the current controller's CController::renderPartial() method. When both 'content' and 'view' are specified, 'content' will take precedence.
  • url: a URL that the user browser will be redirected to when clicking on this tab.
  • data: array (name=>value), this will be passed to the view when 'view' is specified.

For example, the CTabView::$tabs property can be configured as follows,

$this->widget('CTabView', array(
    'tabs'=>array(
        'tab1'=>array(
            'title'=>'tab 1 title',
            'view'=>'view1',
            'data'=>array('model'=>$model),
        ),
        'tab2'=>array(
            'title'=>'tab 2 title',
            'url'=>'http://www.yiiframework.com/',
        ),
    ),
));

By default, the first tab will be activated. To activate a different tab when the page is initially loaded, set CTabView::$activeTab to be the ID of the desired tab.

CComponent
Extended by CBaseController
Extended by CWidget
Extended by CTabView
Package: system\web\widgets
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/widgets/CTabView.php
Methods summary
public
# run( )

Runs the widget.

Runs the widget.

Overrides

CWidget::run()
public
# registerClientScript( )

Registers the needed CSS and JavaScript.

Registers the needed CSS and JavaScript.

public static
# registerCssFile( string $url = null )

Registers the needed CSS file.

Registers the needed CSS file.

Parameters

$url
string
$url the CSS URL. If null, a default CSS URL will be used.
protected
# renderHeader( )

Renders the header part.

Renders the header part.

protected
# renderBody( )

Renders the body part.

Renders the body part.

Methods inherited from CWidget
__construct(), actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), init(), render(), setId()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal(), widget()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
string CSS_CLASS 'yiiTab'
#

Default CSS class for the tab container

Default CSS class for the tab container

Properties summary
public mixed $cssFile
#

the CSS file used for the widget. Defaults to null, meaning using the default CSS file included together with the widget. If false, no CSS file will be used. Otherwise, the specified CSS file will be included when using this widget.

the CSS file used for the widget. Defaults to null, meaning using the default CSS file included together with the widget. If false, no CSS file will be used. Otherwise, the specified CSS file will be included when using this widget.

public string $activeTab
#

the ID of the tab that should be activated when the page is initially loaded. If not set, the first tab will be activated.

the ID of the tab that should be activated when the page is initially loaded. If not set, the first tab will be activated.

public array $viewData
#

the data that will be passed to the partial view rendered by each tab.

the data that will be passed to the partial view rendered by each tab.

public array $htmlOptions
#

additional HTML options to be rendered in the container tag.

additional HTML options to be rendered in the container tag.

public array $tabs array()
#
tab definitions. The array keys are the IDs, and the array values are the corresponding tab contents. Each array value must be an array with the following elements:
  • title: the tab title. You need to make sure this is HTML-encoded.
  • content: the content to be displayed in the tab.
  • view: the name of the view to be displayed in this tab. The view will be rendered using the current controller's CController::renderPartial() method. When both 'content' and 'view' are specified, 'content' will take precedence.
  • url: a URL that the user browser will be redirected to when clicking on this tab.
  • data: array (name=>value), this will be passed to the view when 'view' is specified. This option is available since version 1.1.1.
  • visible: whether this tab is visible. Defaults to true. this option is available since version 1.1.11.
array(
    'tab1'=>array(
          'title'=>'tab 1 title',
          'view'=>'view1',
    ),
    'tab2'=>array(
          'title'=>'tab 2 title',
          'url'=>'http://www.yiiframework.com/',
    ),
)
tab definitions. The array keys are the IDs, and the array values are the corresponding tab contents. Each array value must be an array with the following elements:
  • title: the tab title. You need to make sure this is HTML-encoded.
  • content: the content to be displayed in the tab.
  • view: the name of the view to be displayed in this tab. The view will be rendered using the current controller's CController::renderPartial() method. When both 'content' and 'view' are specified, 'content' will take precedence.
  • url: a URL that the user browser will be redirected to when clicking on this tab.
  • data: array (name=>value), this will be passed to the view when 'view' is specified. This option is available since version 1.1.1.
  • visible: whether this tab is visible. Defaults to true. this option is available since version 1.1.11.
array(
    'tab1'=>array(
          'title'=>'tab 1 title',
          'view'=>'view1',
    ),
    'tab2'=>array(
          'title'=>'tab 2 title',
          'url'=>'http://www.yiiframework.com/',
    ),
)
Properties inherited from CWidget
$actionPrefix, $skin
Magic properties inherited from CWidget
$controller, $id, $owner, $viewPath
API documentation generated by ApiGen 2.8.0