set up a controller in php

Solutions on MaxInterview for set up a controller in php by the best coders in the world

showing results for - "set up a controller in php"
Giulio
28 Mar 2019
1<?php
2// src/Controller/LuckyController.php
3namespace App\Controller;
4
5use Symfony\Component\HttpFoundation\Response;
6
7class LuckyController
8{
9    public function number()
10    {
11        $number = random_int(0, 100);
12
13        return new Response(
14            '<html><body>Lucky number: '.$number.'</body></html>'
15        );
16    }
17}
18