Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2.  
  3. class MyController
  4. {
  5.  
  6. public function getUserInfo(Request $request)
  7. {
  8. $userInfo = $this->getUser()->getBasicInfo();
  9.  
  10. if($request->isXmlHttpRequest()) {
  11. return new JsonResponse([
  12. 'success' => true,
  13. 'error' => null,
  14. 'userInfo' => $userInfo
  15. ], 200);
  16. }
  17.  
  18. return $this->render('templates/userIno.html', [
  19. 'userInfo' => $userInfo
  20. ]);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement