I use an UrlHelper to perform a delete action, like so:
<?php echo link_to('delete', '@foo_delete?id=' . $foo->id, array('method'=>'DELETE'))?>
Which generates all sorts of magic javascript output, and it works.
Now I’m wondering, is there an easy way to use the UrlHelper to do the same thing ajax style?
Thanks!
The
link_to_remotefrom Symfony 1.0 became deprecated.So instead, you can install the sfJqueryReloadedPlugin and use the
jq_link_to_remote()But, there is a problem with this:
sfJqueryReloadedPlugindoes not support the DELETE method, so what you can do is a small change on the plugin. Inplugins/sfJqueryReloadedPlugin/lib/helper/jQueryHelper.phpwhere you read:should be:
(just proposed this change to the plugin developers)