mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 06:01:35 +01:00
Implemented law standart template
This commit is contained in:
parent
379e9c62e9
commit
00cd03f43d
@ -6,6 +6,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use App\Entity\Law;
|
||||
use App\Entity\LawInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -19,12 +20,17 @@ class LawController extends AbstractEntityController
|
||||
*
|
||||
* @Route("/law/{id}.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function show(): Response
|
||||
public function show(int $id): Response
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @todo Implement function!
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @var LawInterface $law
|
||||
*/
|
||||
$law = $this->loadEntityById($id);
|
||||
$view = $this->view($law, 200)
|
||||
->setTemplate('law/view/standard.html.twig')
|
||||
->setTemplateVar('law');
|
||||
return $this->handleView($view);
|
||||
}
|
||||
|
||||
/**
|
||||
|
14
application/src/Repository/LawRepository.php
Normal file
14
application/src/Repository/LawRepository.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace App\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class LawRepository extends EntityRepository
|
||||
{
|
||||
}
|
||||
|
6
application/templates/law/law.html.twig
Normal file
6
application/templates/law/law.html.twig
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends "frames/default.html.twig" %}
|
||||
{% block title %}
|
||||
{% trans %}
|
||||
Law
|
||||
{% endtrans %}
|
||||
{% endblock %}
|
17
application/templates/law/view/standard.html.twig
Normal file
17
application/templates/law/view/standard.html.twig
Normal file
@ -0,0 +1,17 @@
|
||||
{% extends "law/law.html.twig" %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
{% trans %}
|
||||
Law
|
||||
{% endtrans %}
|
||||
#
|
||||
{{ law.id }}
|
||||
</h1>
|
||||
{% trans %}
|
||||
Responsible for:
|
||||
{% endtrans %}
|
||||
<a href="{{ path('app_node_show',{'id':law.node.id})}}"> {% trans with {'%law.node.id%':law.node.id}%}
|
||||
node #%law.node.id% {% endtrans %}
|
||||
</a>
|
||||
.
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user