src/Controller/MenusController.php
public function deleteItem($id)
    {
        $this->request->allowMethod('post');

        $menuItem = $this->MenuItems->get($id);
        if ($this->MenuItems->delete($menuItem)) {
            $this->Flash->success(__d('wasabi_core', 'The menu item <strong>{0}</strong> has been deleted.', $menuItem->get('name')));
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }

        $this->redirect(['action' => 'edit', $menuItem->get('menu_id')]);
        return;
    }
public function deleteItem($id)
    {
        $this->request->allowMethod('post');

        $menuItem = $this->MenuItems->get($id);
        if ($this->MenuItems->delete($menuItem)) {
            $this->Flash->success(__d('wasabi_core', 'The menu item <strong>{0}</strong> has been deleted.', $menuItem->get('name')));
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }

        $this->redirect(['action' => 'edit', $menuItem->get('menu_id')]);
        return;
    }
public function deleteItem ( $ id ) { $ this -> request -> allowMethod ( 'post' ) ; $ menuItem = $ this -> MenuItems -> get ( $ id ) ; if ( $ this -> MenuItems -> delete ( $ menuItem ) ) { $ this -> Flash -> success ( __d ( 'wasabi_core' , 'The menu item <strong>{0}</strong> has been deleted.' , $ menuItem -> get ( 'name' ) ) ) ; } else { $ this -> Flash -> error ( $ this -> dbErrorMessage ) ; } $ this -> redirect ( [ 'action' => 'edit' , $ menuItem -> get ( 'menu_id' ) ] ) ; return ; }
Delete a menu item.
POST

@param string $id
Delete a menu item . POST