-
-
Save mikegrungey/89fe62d36621ab75a75d to your computer and use it in GitHub Desktop.
Revisions
-
elena-kolevska renamed this gist
Jan 8, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ /* |-------------------------------------------------------------------------- | Delete form macro -
elena-kolevska created this gist
Jan 8, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ /* |-------------------------------------------------------------------------- | Delete form macro |-------------------------------------------------------------------------- | | This macro creates a form with only a submit button. | We'll use it to generate forms that will post to a certain url with the DELETE method, | following REST principles. | */ Form::macro('delete',function($url, $button_label='Delete',$form_parameters = array(),$button_options=array()){ if(empty($form_parameters)){ $form_parameters = array( 'method'=>'DELETE', 'class' =>'delete-form', 'url' =>$url ); }else{ $form_parameters['url'] = $url; $form_parameters['method'] = 'DELETE'; }; return Form::open($form_parameters) . Form::submit($button_label, $button_options) . Form::close(); });