Button

Drafting Buttons by the Yii way

//simple text button
echo CHtml::button('Button Text', 
          array('submit' => array('controller/action')));

This will render the following code

<input id="yt0" type="button" value="Button Text" name="yt0"/>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(document).ready(function() {
             jQuery('#yt0').click(function( {
                            jQuery.yii.submitForm(
                                     this,
                                     'controller/action',{}
                                          );return false;});
                                  });
/*]]>*/
</script>

Read more ›

Posted in CHtml

Link and ajaxLink

Creation of a link by the Yii way

//Generates a simple hyperlink tag
echo CHtml::link('Link Text', array('/controller/action'));

Read more ›

Tagged with: , ,
Posted in CHtml
Recent Posts
Recent Comments
Archives
Categories