PageRenderTime 46ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/fuel/packages/oil/views/scaffolding/orm/actions/delete.php

https://bitbucket.org/trujka/codegrounds
PHP | 15 lines | 11 code | 4 blank | 0 comment | 1 complexity | 514232df12f547f3022c37b7241d1cc9 MD5 | raw file
Possible License(s): MIT, BSD-3-Clause, LGPL-2.1
  1. is_null($id) and Response::redirect('<?php echo $uri ?>');
  2. if ($<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find($id))
  3. {
  4. $<?php echo $singular_name; ?>->delete();
  5. Session::set_flash('success', 'Deleted <?php echo $singular_name; ?> #'.$id);
  6. }
  7. else
  8. {
  9. Session::set_flash('error', 'Could not delete <?php echo $singular_name; ?> #'.$id);
  10. }
  11. Response::redirect('<?php echo $uri; ?>');