PHP Development Framework Yii Framework Tutorial (zii) Component-button Example

Source: Internet
Author: User
Tags yii
Cjuibutton Display button, Cjuibutton can be either as a submit button or as 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 '));?>

These three buttons, the first as a Submit button, the second as a normal button, triggering JavaScripts event, the third click after the trigger Otheraction method.

The results appear as follows:

You can add a CSS file for the Jui UI component, which can be set through a 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, using the new CSS style to display as follows:

The above is the PHP Development Framework Yii Framework Tutorial (zii)-button sample content, more relevant content please focus on topic.alibabacloud.com (www.php.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.