View #8

Merged
clement.laporte merged 8 commits from refs/pull/8/head into main 2024-06-07 15:27:55 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 7c7f903160 - Show all commits

View File

@@ -2,6 +2,7 @@
namespace App\Controller;
use App\Entity\Species;
use App\Repository\SpeciesRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@@ -19,9 +20,8 @@ class SpeciesController extends AbstractController
}
#[Route('/species/{id}', name: 'app_species_detail')]
public function detail(SpeciesRepository $repository,int $id): Response
public function detail(Species $specie): Response
{
$specie = $repository->findOneBy(array('id'=>$id));
return $this->render('species/detail.html.twig', [
'specie' => $specie,
]);

View File

@@ -14,7 +14,7 @@
<dl>
{% for specie in species %}
<dt>
<a href={{ "http://" ~ app.request.host ~ ":8000" ~ "/species/" ~ specie.getId }}>
<a href={{ url('app_species') ~ '/' ~ specie.getId }}>
🌿 {{ specie.getVernacularName }}
</a>
</dt>