public function edit($id)
    {
        $this->loadModel('Taxonomy.Vocabularies');
        $vocabulary = $this->Vocabularies->get($id);

        if ($this->request->data()) {
            $vocabulary = $this->Vocabularies->patchEntity($vocabulary, $this->request->data, [
                'fieldList' => [
                    'name',
                    'description',
                ],
            ]);

            if ($this->Vocabularies->save($vocabulary, ['atomic' => true])) {
                $this->Flash->success(__d('taxonomy', 'Vocabulary has been saved!'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('taxonomy', 'Vocabulary could not be saved, please check your information'));
            }
        }

        $this->title(__d('taxonomy', 'Editing Vocabulary'));
        $this->set('vocabulary', $vocabulary);
        $this->Breadcrumb
            ->push('/admin/system/structure')
            ->push(__d('taxonomy', 'Taxonomy'), '/admin/taxonomy/manage')
            ->push(__d('taxonomy', 'Vocabularies'), ['plugin' => 'Taxonomy', 'controller' => 'vocabularies', 'action' => 'index'])
            ->push(__d('taxonomy', 'Editing vocabulary'), '#');
    }
public function edit($id)
    {
        $this->loadModel('Taxonomy.Vocabularies');
        $vocabulary = $this->Vocabularies->get($id);

        if ($this->request->data()) {
            $vocabulary = $this->Vocabularies->patchEntity($vocabulary, $this->request->data, [
                'fieldList' => [
                    'name',
                    'description',
                ],
            ]);

            if ($this->Vocabularies->save($vocabulary, ['atomic' => true])) {
                $this->Flash->success(__d('taxonomy', 'Vocabulary has been saved!'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('taxonomy', 'Vocabulary could not be saved, please check your information'));
            }
        }

        $this->title(__d('taxonomy', 'Editing Vocabulary'));
        $this->set('vocabulary', $vocabulary);
        $this->Breadcrumb
            ->push('/admin/system/structure')
            ->push(__d('taxonomy', 'Taxonomy'), '/admin/taxonomy/manage')
            ->push(__d('taxonomy', 'Vocabularies'), ['plugin' => 'Taxonomy', 'controller' => 'vocabularies', 'action' => 'index'])
            ->push(__d('taxonomy', 'Editing vocabulary'), '#');
    }
public function edit ( $ id ) { $ this -> loadModel ( 'Taxonomy.Vocabularies' ) ; $ vocabulary = $ this -> Vocabularies -> get ( $ id ) ; if ( $ this -> request -> data ( ) ) { $ vocabulary = $ this -> Vocabularies -> patchEntity ( $ vocabulary , $ this -> request -> data , [ 'fieldList' => [ 'name' , 'description' , ] , ] ) ; if ( $ this -> Vocabularies -> save ( $ vocabulary , [ 'atomic' => true ] ) ) { $ this -> Flash -> success ( __d ( 'taxonomy' , 'Vocabulary has been saved!' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; } else { $ this -> Flash -> danger ( __d ( 'taxonomy' , 'Vocabulary could not be saved, please check your information' ) ) ; } } $ this -> title ( __d ( 'taxonomy' , 'Editing Vocabulary' ) ) ; $ this -> set ( 'vocabulary' , $ vocabulary ) ; $ this -> Breadcrumb -> push ( '/admin/system/structure' ) -> push ( __d ( 'taxonomy' , 'Taxonomy' ) , '/admin/taxonomy/manage' ) -> push ( __d ( 'taxonomy' , 'Vocabularies' ) , [ 'plugin' => 'Taxonomy' , 'controller' => 'vocabularies' , 'action' => 'index' ] ) -> push ( __d ( 'taxonomy' , 'Editing vocabulary' ) , '#' ) ; }
Edits the given vocabulary by ID.

@param int $id Vocabulary's ID
@return void
Edits the given vocabulary by ID .