Quantcast
Channel: Web Development Tips » CakePHP
Viewing all articles
Browse latest Browse all 6

Confirm before Deleting post in CakePHP

$
0
0
In the controller, create a delete function: <?php class EmployeeController extends AppController { public function delete($id) { $this->Employee->delete($id); $this->Session->setFlash(‘The Employee is deleted.’); $this->redirect(array(‘action’=>’index’)); } } In the view page, write the following code: <a href=”#” onclick=”return confirm(‘Are you sure you want to delete this Employee?’);”>Delete</a> Filed under: CakePHP Tagged: cakephp, confirm, Confirm before Deleting, delete, […]

Viewing all articles
Browse latest Browse all 6

Trending Articles