Answers for "set up a Controller in php"

PHP
0

set up a Controller in php

<?php
// src/Controller/LuckyController.php
namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;

class LuckyController
{
    public function number()
    {
        $number = random_int(0, 100);

        return new Response(
            '<html><body>Lucky number: '.$number.'</body></html>'
        );
    }
}
Posted by: Guest on April-29-2021

Browse Popular Code Answers by Language