Projekt

Obecné

Profil

Stáhnout (537 Bajtů) Statistiky
| Větev: | Revize:
1
<?php
2

    
3
namespace App\Controller;
4

    
5
use App\Document\Test;
6
use Doctrine\ODM\MongoDB\DocumentManager;
7
use Symfony\Component\HttpFoundation\Response;
8
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
9

    
10
class IndexController extends AbstractController {
11
    public function index(DocumentManager $dm): Response {
12
        $number = random_int(0, 100);
13

    
14
        $test = $dm->getRepository(Test::class)->findAll();
15

    
16
        return new Response(
17
            '<html><body>Lucky number: '.$number.'</body></html>'
18
        );
19
    }
20
}
(2-2/2)