The CJuiButton display button. CJuiButton can be either a Submit button or a normal button. The CJuiButton display button. CJuiButton can be either a Submit button or a normal button.
The basic usage of the button 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'),)); ?>
The first button serves as the Submit button, the second button serves as the normal button to trigger the JavaScripts event, and the third button to trigger the otherAction method.
The result is as follows:
You can add a CSS file for the Jui UI component, 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',),),),
Here we copy the JQuery CSS file used by YiiPlayground. The new CSS style is displayed as follows:
The above is the content of the Zii component-Button sample in the PHP development Framework Yii Framework tutorial (35). For more information, see PHP Chinese website (www.php1.cn )!