The cjuitabs displays the paging UI component, similar to the Yii Framework Development Tutorial (Tabview) UI component, which encapsulates the JUI tabs plug-in.
The former basic usage is as follows:
<?php $this->widget (' Zii.widgets.jui.CJuiTabs ', Array (
' tabs ' =>array ('
static tab ' => ' static Content ',
' Render tab ' => $this->renderpartial (' pages/_content1 ', null,true),
' Ajax tab ' =>array (' Ajax ' =>array (' ajaxcontent ', ' View ' => ' _content2 '),
),
' Options ' =>array (
' collapsible ' => True,
' selected ' =>1,
),
' Htmloptions ' =>array (
' style ' => ' width:500px; '
),
));?>
Displays three different content display methods, static tab to display a passive content, Render tab uses partial to render a page, while Ajax tab displays a page via Ajax, Note the following two needs are defined in Sitecontroller as follows:
Public function
actions ()
{return
array ('
page ' =>array ('
class ' => ' Cviewaction '
) ,
//ajaxcontent action renders
//"Static" pages stored under ' protected/views/site/pages '
//They can be ACC Essed via:
//index.php?r=site/ajaxcontent&view=filename
' ajaxcontent ' =>array (
' class ' = > ' application.controllers.AjaxViewAction ',)
,
);
}
Where Ajaxviewaction is a custom viewaction, a subclass of cviewaction that can display a static page, which is defined as follows:
Class Ajaxviewaction extends Cviewaction
{
private $_viewpath;
Public function run ()
{
if (Yii::app ()->request->isajaxrequest)
{
$this->resolveview ($ This->getrequestedview ());
$controller = $this->getcontroller ();
$controller->renderpartial ($this->view, NULL, FALSE, True);
}
else
throw new chttpexception, ' Invalid request.
Please don't repeat this request again. '}
}
The results appear as follows:
See a full set of tutorials: http://www.bianceng.cn/webkf/PHP/201301/35265.htm
This example downloads: Http://www.imobilebbs.com/download/yii/JuiProgressBarDemo.zip