CJuiButton displays a button. CJuiButton can be used as a Submit button or an ordinary button.
The basic usage of buttons is as follows:
widget('zii.widgets.jui.CJuiButton', array( 'buttonType'=>'submit', 'name'=>'btnSubmit', 'value'=>'1', 'caption'=>'Submit', 'htmlOptions'=>array('class'=>'ui-button-primary') )); ?> widget('zii.widgets.jui.CJuiButton', array( 'buttonType'=>'button', 'name'=>'btnClick', 'caption'=>'Click', //'options'=>array('icons'=>'js:{primary:"ui-icon-newwin"}'), 'onclick'=>'js:function(){alert("clicked"); this.blur(); return false;}', )); ?> widget('zii.widgets.jui.CJuiButton', array( 'buttonType'=>'link', 'name'=>'btnGo', 'caption'=>'Go', //'options'=>array('icons'=>'js:{secondary:"ui-icon-extlink"}'), 'url'=>array('site/other'), )); ?>
Of these three buttons, the first is used as a Submit button, the second is used as a normal button, triggering JavaScripts events, and the third triggers the otherAction method after being clicked. .
The display result is as follows:
##You can add CSS files for Jui UI components, which can be set through the configuration file:'components'=>array( 'clientScript' => array( 'scriptMap' => array( 'jquery-ui.css'=> dirname($_SERVER['SCRIPT_NAME']) .'/css/jui/custom/jquery-ui.css', ), ), ),