sajad torkamani

Make sure you install the Symfony CLI first.

Create project

symfony new my_project_directory --version="<latest-version" --webapp

Create database:

php bin/console doctrine:database:create

Create example page



namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class HomeController extends AbstractController
    public function index(): Response
        return $this->render('home/index.html.twig');


{% extends 'base.html.twig' %}

{% block body %}
    <h1>Hello world</h1>
{% endblock %}

Start server

symfony server:start

Go to http://localhost:8000 to view your homepage.


Tagged: Symfony