PHP development framework YiiFramework tutorial (35) Zii component-Button example

Source: Internet
Author: User
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 )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.