Home  >  Article  >  Backend Development  >  PHP development framework Yii Framework tutorial (33) Zii component-Accordion example

PHP development framework Yii Framework tutorial (33) Zii component-Accordion example

黄舟
黄舟Original
2017-01-22 09:51:011494browse

The Zii component contains some UI components based on JQuery, which are defined in the package zii.widgets.jui, including CJuiAccordion, CJuiAutoComplete, CJuiDatePicker, etc. This article introduces CJuiAccordion, which displays an Accordion component (a UI component that can be folded like an accordion). This control encapsulates the JUI Accordion plug-in.

Basic usage is as follows:

$this->widget('zii.widgets.jui.CJuiAccordion', 
array('panels'=>array('panel 1'=>'Content for panel 1','panel 2'=>'Content for panel 2',
'panel 3'=>$this->renderPartial('_content1',null,true),),'options'=>array('collapsible'=>true,'active'=>1,),
'htmlOptions'=>array('style'=>'width:500px;'),));
?>

Define several foldable pages of Accordion by defining the panels attribute, and transmit parameters to the JUI Accordion plug-in by configuring options.

The above is the content of the PHP development framework Yii Framework tutorial (33) Zii component-Accordion example. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn