/fuel/packages/oil/views/scaffolding/orm/actions/delete.php
PHP | 15 lines | 11 code | 4 blank | 0 comment | 1 complexity | 0b369c6826c786bf5cbfe2d0659b5636 MD5 | raw file
Possible License(s): MIT, Apache-2.0
- is_null($id) and Response::redirect('<?php echo $controller_name ?>');
- if ($<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find($id))
- {
- $<?php echo $singular_name; ?>->delete();
- Session::set_flash('success', 'Deleted <?php echo $singular_name; ?> #'.$id);
- }
- else
- {
- Session::set_flash('error', 'Could not delete <?php echo $singular_name; ?> #'.$id);
- }
- Response::redirect('<?php echo $uri; ?>');