[CORE][ROUTES] Example route

This commit is contained in:
Hugo Sales 2020-03-12 17:59:13 +00:00 committed by Hugo Sales
parent 7da61f8db5
commit b396f1227a
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 46 additions and 0 deletions

10
config/routes.php Normal file
View File

@ -0,0 +1,10 @@
<?php
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use App\Controller\NetworkPublic;
return function (RoutingConfigurator $routes) {
$routes->add('network.public', '/main/all')
->controller(NetworkPublic::class);
};

View File

@ -0,0 +1,16 @@
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use App;
class NetworkPublic extends AbstractController
{
public function __invoke()
{
return $this->render('network/public.html.twig', []);
}
}

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
<style>
body {
background-color: #333;
color: #ddd;
}
</style>
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
<h1>Imagine some notices here</h1>
</body>
</html>