Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function delete () {
- if( isset($_POST) && !empty($_POST) ) {
- $Validator = new Validator;
- $Validator->validation_rules(array(
- 'id' => 'required|numeric',
- ));
- $validated = $Validator->run($_POST, true);
- if($validated === false) {
- echo helperModel::toJson(
- array(
- 'success'=>0,
- 'message'=>$Validator->get_readable_errors(true)
- ));
- } else {
- $delete_contact = (new contactModel)->delete($validated['id']);
- if($delete_contact){
- echo helperModel::toJson(array('success'=>1));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment