public function edit($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($this->request->data()) {
            $menu = $this->Menus->patchEntity($menu, $this->request->data(), [
                'fieldList' => [
                    'title',
                    'description',
                    'settings',
                ],
                'validate' => false
            ]);

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

        $this->title(__d('menu', 'Editing Menu'));
        $this->set('menu', $menu);
        $this->Breadcrumb
            ->push('/admin/menu/manage')
            ->push(__d('menu', 'Editing menu {0}', $menu->title), '#');
    }
public function edit($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($this->request->data()) {
            $menu = $this->Menus->patchEntity($menu, $this->request->data(), [
                'fieldList' => [
                    'title',
                    'description',
                    'settings',
                ],
                'validate' => false
            ]);

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

        $this->title(__d('menu', 'Editing Menu'));
        $this->set('menu', $menu);
        $this->Breadcrumb
            ->push('/admin/menu/manage')
            ->push(__d('menu', 'Editing menu {0}', $menu->title), '#');
    }
public function edit ( $ id ) { $ this -> loadModel ( 'Menu.Menus' ) ; $ menu = $ this -> Menus -> get ( $ id ) ; if ( $ this -> request -> data ( ) ) { $ menu = $ this -> Menus -> patchEntity ( $ menu , $ this -> request -> data ( ) , [ 'fieldList' => [ 'title' , 'description' , 'settings' , ] , 'validate' => false ] ) ; if ( $ this -> Menus -> save ( $ menu , [ 'atomic' => true ] ) ) { $ this -> Flash -> success ( __d ( 'menu' , 'Menu has been saved!' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; } else { $ this -> Flash -> danger ( __d ( 'menu' , 'Menu could not be saved, please check your information' ) ) ; } } $ this -> title ( __d ( 'menu' , 'Editing Menu' ) ) ; $ this -> set ( 'menu' , $ menu ) ; $ this -> Breadcrumb -> push ( '/admin/menu/manage' ) -> push ( __d ( 'menu' , 'Editing menu {0}' , $ menu -> title ) , '#' ) ; }
Edits the given menu by ID.

@param int $id Menu's ID
@return void
Edits the given menu by ID .