public function delete($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($menu->handler === 'Menu' && $this->Menus->delete($menu)) {
            $this->Flash->success(__d('menu', 'Menu has been successfully deleted!'));
        } else {
            $this->Flash->danger(__d('menu', 'Menu could not be deleted, please try again'));
        }

        $this->title(__d('menu', 'Delete Menu'));
        $this->redirect($this->referer());
    }
public function delete($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($menu->handler === 'Menu' && $this->Menus->delete($menu)) {
            $this->Flash->success(__d('menu', 'Menu has been successfully deleted!'));
        } else {
            $this->Flash->danger(__d('menu', 'Menu could not be deleted, please try again'));
        }

        $this->title(__d('menu', 'Delete Menu'));
        $this->redirect($this->referer());
    }
public function delete ( $ id ) { $ this -> loadModel ( 'Menu.Menus' ) ; $ menu = $ this -> Menus -> get ( $ id ) ; if ( $ menu -> handler === 'Menu' && $ this -> Menus -> delete ( $ menu ) ) { $ this -> Flash -> success ( __d ( 'menu' , 'Menu has been successfully deleted!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'menu' , 'Menu could not be deleted, please try again' ) ) ; } $ this -> title ( __d ( 'menu' , 'Delete Menu' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Removes the given menu by ID.

Only custom menus (those created using administration page) can be removed.

@param int $id Menu's ID
@return void Redirects to previous page
Removes the given menu by ID .