public function layoutAction(Request $request)
    {
        $block = $this->findBlockByRequest($request);

        $data = $request->request->get('data', []);

        try {
            $this->getEditor()->getLayoutAdapter()->updateBlockLayout($block, $data);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($block);
        $this->persist($block);

        $data = [
            'blocks' => [$this->getViewBuilder()->buildBlock($block)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
public function layoutAction(Request $request)
    {
        $block = $this->findBlockByRequest($request);

        $data = $request->request->get('data', []);

        try {
            $this->getEditor()->getLayoutAdapter()->updateBlockLayout($block, $data);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($block);
        $this->persist($block);

        $data = [
            'blocks' => [$this->getViewBuilder()->buildBlock($block)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
public function layoutAction ( Request $ request ) { $ block = $ this -> findBlockByRequest ( $ request ) ; $ data = $ request -> request -> get ( 'data' , [ ] ) ; try { $ this -> getEditor ( ) -> getLayoutAdapter ( ) -> updateBlockLayout ( $ block , $ data ) ; } catch ( EditorExceptionInterface $ e ) { return $ this -> handleException ( $ e ) ; } $ this -> validate ( $ block ) ; $ this -> persist ( $ block ) ; $ data = [ 'blocks' => [ $ this -> getViewBuilder ( ) -> buildBlock ( $ block ) ] , ] ; return $ this -> buildResponse ( $ data , self :: SERIALIZE_LAYOUT ) ; }
Updates the block layout.

@param Request $request

@return Response
Updates the block layout .