-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% extends "base.html.twig" %} | ||
|
||
{% block title %}Error{% endblock %} | ||
|
||
{% block content %} | ||
<h1>Error Default Route</h1> | ||
{% endblock %} | ||
|
41 changes: 41 additions & 0 deletions
41
src/EduFramework/Core/Controller/Error/HttpErrorDefaultController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/* | ||
* Ce fichier fait partie du Studoo | ||
* | ||
* @author Benoit Foujols | ||
* | ||
* Pour les informations complètes sur les droits d'auteur et la licence, | ||
* veuillez consulter le fichier LICENSE qui a été distribué avec ce code source. | ||
*/ | ||
|
||
namespace Studoo\EduFramework\Core\Controller\Error; | ||
|
||
use Studoo\EduFramework\Core\Controller\ControllerInterface; | ||
use Studoo\EduFramework\Core\Controller\Request; | ||
use Studoo\EduFramework\Core\View\TwigCore; | ||
use Twig\Error\LoaderError; | ||
use Twig\Error\RuntimeError; | ||
use Twig\Error\SyntaxError; | ||
|
||
/** | ||
* Class HttpErrorDefaultController | ||
* Classe Controller pour les erreurs HTTP | ||
*/ | ||
class HttpErrorDefaultController implements ControllerInterface | ||
{ | ||
/** | ||
* Si y a pas de route valide alors j'affiche la page 404 | ||
* @param Request $request Objet de la requête | ||
* @return string | ||
* @throws SyntaxError | ||
* @throws RuntimeError | ||
* @throws LoaderError | ||
*/ | ||
public function execute(Request $request): string | ||
{ | ||
return TwigCore::getEnvironment()->render( | ||
'error/http-Default.html.twig', | ||
[] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters