Revision #29 was created by resurtm on Aug 11, 2011, 8:37:16 AM.
generating dropdownlists with optgroup
Content
[...]
***
**Example 9: Linking to a controller action via POST with confirmation dialog**
Delete actions created using gii require the delete request be sent via POST to help prevent deleting objects by accident. Below is an example how to create a link that sends the request via POST and also asks for confirmation. Where you are redirected after the delete depends on your delete action.
```php
<?php echo CHtml::link('Delete',"#", array("submit"=>array('delete', 'id'=>$data->ID), 'confirm' => 'Are you sure?')); ?Note that the `id` link parameter below is a GET type parameter (submit URL will be something like `http://example.com/post/delete/id/100`).
**Example 10: Linking to a controller action via POST with POST parameters**
If you need to make POST request with arbitary link with additional POST parameters you should use following code (submit URL will be something like `http://example.com/blog/deletePost/param/100`).
```php
<p><?php echo lnk('Delete blog post', '#', array(
**Example 5:*
You cand find CHtml class at `yii/framework/web/helpers/CHtml.php`.
## Links
[Russian Version dropDownList()](http://dbhelp.ru/by-example-chtml-dropdownlist/page/)
[Russian Version listData()](http://dbhelp.ru/by-example-chtml-listdata/page/)