Skip to content

Instantly share code, notes, and snippets.

@radutopala
Created May 29, 2012 08:28
Show Gist options
  • Save radutopala/2823308 to your computer and use it in GitHub Desktop.
Save radutopala/2823308 to your computer and use it in GitHub Desktop.
Delete row action
<?php
class deleteAction extends sfAction
{
public function execute($request)
{
if ($request->isMethod('post')) {
$fhr = MyModelQuery::create()->findPk($this->getRequestParameter('id'));
if($fhr != null)
{
$fhr->delete();
$result = array(
'success' => true,
'message' => "Removed with success!",
'executeAfter' => ''
);
return $result;
}
}
}
}
<i:rowactions>
<i:action iconCls="icon-minus" name="delete" post="true" tooltip="Delete" url="mymodule/delete"/>
</i:rowactions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment