src/Controller/PressApiController.php
/**
     * @param ServerRequestInterface $request
     * @param array $args
     * @return ResponseInterface $response
     */
@param ServerRequestInterface $request
@param array $args
@return ResponseInterface $response
@param ServerRequestInterface $request @param array $args @return ResponseInterface $response
public function addBlockAction(ServerRequestInterface $request, array $args): ResponseInterface
    {
        $post = $request->getParsedBody();
        $postId = $request->getAttribute('id');
        $page = $this->cms->fetchPage($postId);
        $data = $page ? $this->cms->getPageEditor()->addNewBlock($page, $post['class']) : ['error' => 'Page not found.'];
        return new JsonResponse($data);
    }
public function addBlockAction ( ServerRequestInterface $ request , array $ args ) : ResponseInterface { $ post = $ request -> getParsedBody ( ) ; $ postId = $ request -> getAttribute ( 'id' ) ; $ page = $ this -> cms -> fetchPage ( $ postId ) ; $ data = $ page ? $ this -> cms -> getPageEditor ( ) -> addNewBlock ( $ page , $ post [ 'class' ] ) : [ 'error' => 'Page not found.' ] ; return new JsonResponse ( $ data ) ; }
@param ServerRequestInterface $request
 @param array $args
 @return ResponseInterface $response
@param ServerRequestInterface $request @param array $args @return ResponseInterface $response