public function delete($id)
    {
        $this->loadModel('Taxonomy.Vocabularies');
        $vocabulary = $this->Vocabularies->get($id, [
            'conditions' => [
                'locked' => 0
            ]
        ]);

        if ($this->Vocabularies->delete($vocabulary)) {
            $this->Flash->success(__d('taxonomy', 'Vocabulary has been successfully deleted!'));
        } else {
            $this->Flash->danger(__d('taxonomy', 'Vocabulary could not be deleted, please try again'));
        }

        $this->title(__d('taxonomy', 'Delete Vocabulary'));
        $this->redirect($this->referer());
    }
public function delete($id)
    {
        $this->loadModel('Taxonomy.Vocabularies');
        $vocabulary = $this->Vocabularies->get($id, [
            'conditions' => [
                'locked' => 0
            ]
        ]);

        if ($this->Vocabularies->delete($vocabulary)) {
            $this->Flash->success(__d('taxonomy', 'Vocabulary has been successfully deleted!'));
        } else {
            $this->Flash->danger(__d('taxonomy', 'Vocabulary could not be deleted, please try again'));
        }

        $this->title(__d('taxonomy', 'Delete Vocabulary'));
        $this->redirect($this->referer());
    }
public function delete ( $ id ) { $ this -> loadModel ( 'Taxonomy.Vocabularies' ) ; $ vocabulary = $ this -> Vocabularies -> get ( $ id , [ 'conditions' => [ 'locked' => 0 ] ] ) ; if ( $ this -> Vocabularies -> delete ( $ vocabulary ) ) { $ this -> Flash -> success ( __d ( 'taxonomy' , 'Vocabulary has been successfully deleted!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'taxonomy' , 'Vocabulary could not be deleted, please try again' ) ) ; } $ this -> title ( __d ( 'taxonomy' , 'Delete Vocabulary' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Removes the given vocabulary by ID.

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