original_string: 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());
      }
code: 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());
      }
code_tokens: 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 ( ) ) ; }
docstring: 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
docstring_tokens: Removes the given menu by ID .