Skip to content
Snippets Groups Projects
Commit e0b86c17 authored by KARAKURT EMINE-RANA's avatar KARAKURT EMINE-RANA :speech_balloon:
Browse files

final

parent a5fd4dbb
Branches
No related merge requests found
......@@ -19,27 +19,7 @@ use Symfony\Component\Routing\Annotation\Route;
*/
class Achat2Controller extends AbstractController
{
/**
* @Route("/", name="app_achat_index", methods={"GET"})
*/
public function index(): Response
{
$user = $this->getUser();
return $this->render('achat/index.html.twig', [
'achats' => $user->getAchats()
]);
}
/**
* @Route("/admin", name="app_achat_index_admin", methods={"GET"})
*/
public function indexAdmin(Achat2Repository $achat2Repository): Response
{
return $this->render('achat2/index.html.twig', [
'achats' => $achat2Repository->findAll(),
]);
}
/**
* @Route("/new", name="app_achat2_new", methods={"GET", "POST"})
......
......@@ -39,6 +39,7 @@
{% endfor %}
</tbody>
</table>
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ path('app_achat_new') }}">Create new</a>
{% endif %}
{% endblock %}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment