* @link http://www.yiiframework.com/ * @copyright 2008-2013 Yii Software LLC * @license http://www.yiiframework.com/license/ */ Yii::import('zii.widgets.jui.CJuiWidget'); /** * CJuiTabs displays a tabs widget. * * CJuiTabs encapsulates the {@link http://jqueryui.com/tabs/ JUI tabs} * plugin. * * To use this widget, you may insert the following code in a view: *
* $this->widget('zii.widgets.jui.CJuiTabs',array(
* 'tabs'=>array(
* 'StaticTab 1'=>'Content for tab 1',
* 'StaticTab 2'=>array('content'=>'Content for tab 2', 'id'=>'tab2'),
* // panel 3 contains the content rendered by a partial view
* 'AjaxTab'=>array('ajax'=>$ajaxUrl),
* ),
* // additional javascript options for the tabs plugin
* 'options'=>array(
* 'collapsible'=>true,
* ),
* ));
*
*
* By configuring the {@link options} property, you may specify the options
* that need to be passed to the JUI tabs plugin. Please refer to
* the {@link http://api.jqueryui.com/tabs/ JUI Tabs API} documentation
* for possible options (name-value pairs) and
* {@link http://jqueryui.com/tabs/ JUI Tabs page} for general
* description and demo.
*
* Note, in case you're using <base/> HTML tag you may run into the
* issue when jQuery UI uses altered base URL to load content, but not
* the base URL content was loaded from. (Developer may expect both behavior
* in different cases.) For this occasion consider using absolute URL
* generation as follows:
*
*
* $this->widget('zii.widgets.jui.CJuiTabs',array(
* 'tabs'=>array(
* 'Dynamic Tab'=>array('ajax'=>$this->createAbsoluteUrl('tab/content/route')),
* ),
* ));
*
*
* @author Sebastian Thierer
* array('id'=>'myTabID', 'content'=>'tab content')
* array('id'=>'myTabID', 'ajax'=>URL)
*
* where the 'id' element is optional. The second format allows the tab content
* to be dynamically fetched from the specified URL via AJAX. The URL can be either
* a string or an array. If an array, it will be normalized into a URL using {@link CHtml::normalizeUrl}.
*/
public $tabs=array();
/**
* @var string the name of the container element that contains all panels. Defaults to 'div'.
*/
public $tagName='div';
/**
* @var string the template that is used to generated every panel title.
* The token "{title}" in the template will be replaced with the panel title and
* the token "{url}" will be replaced with "#TabID" or with the url of the ajax request.
*/
public $headerTemplate='