Revision #6 has been created by smarthead on Sep 29, 2009, 1:39:55 AM with the memo:
Add link()
« previous (#5) next (#7) »
Changes
Title
unchanged
By Example: CHtml
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
Content
changed
[...]
#### HTML Output:
```php
<a href="index.php?r=controller/action¶m1=value1¶m2=value2¶m3=value3">Link Text</a>
```
_
_
## Chtml::button() method
~~~
public static string button(string $label='button', array $htmlOptions=array ( ))
~~~
Generates a button.
***
### Example 1: Connecting a button to a controller action
```php
<?php echo CHtml::button('Button Text', array('submit' => 'controller/action')); ?>
```
#### HTML Output:
```php
<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>
```