src/Controller/MainController.php line 24

Open in your IDE?
  1. <?php
  2. // src/Controller/MainController.php
  3. namespace App\Controller;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Doctrine\ODM\MongoDB\DocumentManager;
  8. use App\Document\User;
  9. use App\Document\Setting;
  10. use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
  11. use App\Controller\NotificationController;
  12. use App\Controller\WalletController;
  13. use App\Controller\CurrenciesController;
  14. use Symfony\Contracts\HttpClient\HttpClientInterface;
  15. class MainController extends AbstractController
  16. {
  17.     #[Route('/' ,  name'home_page')]
  18.     public function number(DocumentManager  $doctrine UserPasswordHasherInterface $passwordHasher HttpClientInterface $client  ):Response
  19.     {
  20.      
  21.     $setting =  $doctrine->createQueryBuilder(Setting::class)
  22.     ->limit(1)
  23.      ->getQuery()
  24.      ->getSingleResult(); 
  25.      
  26.      
  27.      print_r($setting);
  28.    
  29. //     $c = new CurrenciesController($client,$doctrine);
  30. //    $a =  $c->getcurrenciesfromexchange();
  31.         //  $subject = "" ;   $text  = " " ;   $html = "" ;
  32.         //  $email_test = (new NotificationController)->sendemail( $subject ,  $text ,   $html);
  33.         // $tabligh = new User();
  34.         // $test = 'admin';
  35.         
  36.         // $pass = '$AronBit88';
  37.         // $tabligh->setUsername($test);
  38.         // $tabligh->setEmail('test');
  39.         // $hashedPassword = $passwordHasher->hashPassword(
  40.         //     $tabligh,
  41.         //     $pass
  42.         // );
  43.         // $tabligh->setPassword($hashedPassword);
  44.         // $tabligh->setRoles(["ROLE_ADMIN"]);
  45.  
  46.         // $doctrine->persist($tabligh);
  47.        
  48.         // $doctrine->flush();
  49.      
  50.         return new Response(
  51.                '<html><body>Lucky number: 77</body></html>'
  52.         );
  53.     }
  54. }