public function edit($id)
    {
        $this->loadModel('Taxonomy.Terms');
        $term = $this->Terms->get($id, ['contain' => ['Vocabularies']]);
        $vocabulary = $term->vocabulary;

        if ($this->request->data()) {
            $term = $this->Terms->patchEntity($term, $this->request->data(), ['fieldList' => ['name']]);
            $errors = $term->errors();

            if (empty($errors)) {
                $this->Terms->save($term, ['associated' => false]);
                $this->Flash->success(__d('taxonomy', 'Term has been updated'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('taxonomy', 'Term could not be updated, please check your information'));
            }
        }

        $this->title(__d('taxonomy', 'Editing Term'));
        $this->set('term', $term);
        $this->Breadcrumb
            ->push('/admin/system/structure')
            ->push(__d('taxonomy', 'Taxonomy'), '/admin/taxonomy/manage')
            ->push(__d('taxonomy', 'Vocabularies'), ['plugin' => 'Taxonomy', 'controller' => 'vocabularies', 'action' => 'index'])
            ->push("\"{$vocabulary->name}\"", ['plugin' => 'Taxonomy', 'controller' => 'vocabularies', 'action' => 'edit', $vocabulary->id])
            ->push(__d('taxonomy', 'Terms'), ['plugin' => 'Taxonomy', 'controller' => 'terms', 'action' => 'vocabulary', $vocabulary->id])
            ->push(__d('taxonomy', 'Editing term'), '#');
    }