src/Controller/AbstractVocabulariesController.php
public function edit($id = null)
    {
        $vocabulary = $this->Vocabularies->get($id, [
            'contain' => []
        ]);
        if ($this->request->is(['patch', 'post', 'put'])) {
            $vocabulary = $this->Vocabularies->patchEntity($vocabulary, $this->request->data);
            if ($this->Vocabularies->save($vocabulary)) {
                $this->Flash->success(__('The vocabulary has been saved.'));

                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error(__('The vocabulary could not be saved. Please, try again.'));
            }
        }
        $this->set(compact('vocabulary'));
        $this->set('_serialize', ['vocabulary']);
    }
public function edit($id = null)
    {
        $vocabulary = $this->Vocabularies->get($id, [
            'contain' => []
        ]);
        if ($this->request->is(['patch', 'post', 'put'])) {
            $vocabulary = $this->Vocabularies->patchEntity($vocabulary, $this->request->data);
            if ($this->Vocabularies->save($vocabulary)) {
                $this->Flash->success(__('The vocabulary has been saved.'));

                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error(__('The vocabulary could not be saved. Please, try again.'));
            }
        }
        $this->set(compact('vocabulary'));
        $this->set('_serialize', ['vocabulary']);
    }
Edit method

@param string|null $id Vocabulary id.
@return \Cake\Network\Response|void Redirects on successful edit, renders view otherwise.
@throws \Cake\Network\Exception\NotFoundException When record not found.