Added main controller.

This commit is contained in:
2020-01-11 00:26:39 +03:00
parent 3c332466d1
commit 383425d7de
4 changed files with 30 additions and 3 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"sensio/framework-extra-bundle": "^5.1",
"sensio/framework-extra-bundle": "^5.5",
"symfony/apache-pack": "^1.0",
"symfony/asset": "4.4.*",
"symfony/console": "4.4.*",
@@ -23,7 +23,7 @@
"symfony/security-bundle": "4.4.*",
"symfony/serializer-pack": "*",
"symfony/translation": "4.4.*",
"symfony/twig-pack": "*",
"symfony/twig-pack": "^1.0",
"symfony/validator": "4.4.*",
"symfony/web-link": "4.4.*",
"symfony/yaml": "4.4.*"
Generated
+1 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "bbb0d7b62b68b9ef9d037c916211df35",
"content-hash": "d6e8bc8b46d0e946a35999599cf79156",
"packages": [
{
"name": "doctrine/annotations",
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class MainController extends AbstractController
{
/**
* @Route("/")
*/
public function index(): Response
{
$number = random_int(0, 100);
return $this->render('main.twig', [
'number' => $number,
]);
}
}
+5
View File
@@ -0,0 +1,5 @@
{% extends 'base.html.twig' %}
{% block body %}
<h1>Your lucky number is {{ number }}</h1>
{% endblock %}