src\Controller\IndexController.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Controller\AppController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class IndexController extends AppController
  7. {
  8.     
  9.     public function index(): Response
  10.     {  
  11.         
  12.        
  13.         
  14.         
  15. //        if($this->defaultHomePage !== NULL && $this->defaultHomePage !== 'index'){
  16. //            return  $this->redirectToRoute($this->defaultHomePage); 
  17. //        }
  18.         
  19.         $check $this->commonCalls();         
  20.         if($this->RedirectHandle!==NULL){
  21.             return $this->RedirectHandle;
  22.         }
  23.         if(!$check){
  24.             return $check;
  25.         }
  26.         
  27.         
  28.         foreach($this->getData('cards') as $card){
  29.             if($card["card_btn_route"]==="tools"){
  30.                 $this->setData('toolsFlag'true);
  31.                 $this->Session->set('toolsFlag'true);
  32.             }
  33.         }
  34.         if($this->getUser()!==NULL && $this->getUser()->getId()){ 
  35.             $this->setData('toolsFlag'false);
  36.             
  37.             
  38.             
  39.             
  40.             $resTools $this->ApiCalls->getProfileTools($this->getUser()->getEmail());
  41.             $check $this->handleDbErrors($resTools);
  42.             if($check===FALSE){
  43.                 $this->setData('tools'$resTools);
  44.             }
  45.             else{
  46.                 return $check;
  47.             }
  48.         }
  49.         
  50.         
  51. //        var_dump($this->defaultHomePage);
  52. //        var_dump($this->getData('cards'));
  53.         
  54.         
  55.         
  56.         return $this->render($this->customRenderPath('index/index.html.twig'FALSE), 
  57.             $this->getData()
  58.         );
  59.        
  60.     }  
  61. }