src/Phlexible/Bundle/DashboardBundle/Controller/PortletController.php
public function saveAction(Request $request)
    {
        $portlets = $request->request->get('portlets');
        $portlets = json_decode($portlets, true);

        if (!is_array($portlets)) {
            return new ResultResponse(false, 'Portlets data invalid.');
        }

        $user = $this->getUser();
        $user->setProperty('portlets', json_encode($portlets));

        $this->get('phlexible_user.user_manager')->updateUser($user);

        return new ResultResponse(true, 'Portlets saved.');
    }
public function saveAction(Request $request)
    {
        $portlets = $request->request->get('portlets');
        $portlets = json_decode($portlets, true);

        if (!is_array($portlets)) {
            return new ResultResponse(false, 'Portlets data invalid.');
        }

        $user = $this->getUser();
        $user->setProperty('portlets', json_encode($portlets));

        $this->get('phlexible_user.user_manager')->updateUser($user);

        return new ResultResponse(true, 'Portlets saved.');
    }
public function saveAction ( Request $ request ) { $ portlets = $ request -> request -> get ( 'portlets' ) ; $ portlets = json_decode ( $ portlets , true ) ; if ( ! is_array ( $ portlets ) ) { return new ResultResponse ( false , 'Portlets data invalid.' ) ; } $ user = $ this -> getUser ( ) ; $ user -> setProperty ( 'portlets' , json_encode ( $ portlets ) ) ; $ this -> get ( 'phlexible_user.user_manager' ) -> updateUser ( $ user ) ; return new ResultResponse ( true , 'Portlets saved.' ) ; }
Save portlets.

@param Request $request

@return ResultResponse
@Route("/save", name="dashboard_portlets_save")
@Method("POST")
@ApiDoc(
description="Save user portlets",
parameters={
{"name"="portlets", "dataType"="array", "required"=true, "description"="Portlet data"}
}
)
Save portlets .