parent
f0f720ae3e
commit
52b63aaec1
@ -0,0 +1,7 @@
|
|||||||
|
INSERT INTO profil (id, name, description, password)
|
||||||
|
VALUES (
|
||||||
|
7,
|
||||||
|
'name:VARCHAR(255)',
|
||||||
|
'description:VARCHAR(255)',
|
||||||
|
'password:VARCHAR(255)'
|
||||||
|
);
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Entity\Profil;
|
||||||
|
use Doctrine\ORM\EntityManager;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
class ProfilController extends AbstractController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function __construct(private EntityManager $mgr) {}
|
||||||
|
|
||||||
|
#[Route('/profil/{id}',requirements: ['page' => '\d+'])]
|
||||||
|
public function profil(int $id): Response
|
||||||
|
{
|
||||||
|
$profil = $this->mgr->find(Profil::class,$id);
|
||||||
|
return $this->render('profil/index.html.twig', [
|
||||||
|
'profil' => $profil
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/profil/{id}/follow',requirements: ['page' => '\d+'])]
|
||||||
|
public function followProfil(int $id): Response
|
||||||
|
{
|
||||||
|
// $profil = $this->mgr->find(Profil::class,$id);
|
||||||
|
return $this->render('profil/index.html.twig', [
|
||||||
|
// 'profil' => $profil
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
{# templates/profil/show.html.twig #}
|
||||||
|
|
||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Profil - {{ profil.name }}{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Profil: {{ profil.name }}</h1>
|
||||||
|
<p>ID: {{ profil.id }}</p>
|
||||||
|
<p>Description: {{ profil.description }}</p>
|
||||||
|
{% endblock %}
|
Binary file not shown.
Loading…
Reference in new issue