symfony install code example
Example 1: symfony assets install
composer require symfony/asset
Example 2: symfony install website skeleton
composer create-project symfony/website-skeleton my_project_name
Example 3: symfony
<?php
// src/Controller/LuckyController.php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
class LuckyController
{
public function number(): Response
{
$number = random_int(0, 100);
return new Response(
'<html><body>Lucky number: '.$number.'</body></html>'
);
}
}
Example 4: create symfony project
/usr/bin/composer create-project symfony/skeleton /home/handwork/symfony
Example 5: symfony new project
$ symfony new my_project_name --version=lts
$ symfony new my_project_name --version=next
$ symfony new my_project_name --version=4.4