File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -58,28 +58,6 @@ <h2>What is Stack?</h2>
5858 <img src="{{ site.url }}/img/middleware.png" alt="">
5959 </figure>
6060 -->
61-
62- < p > A simple middleware, which appends "YOLO!" in big bold text to every request, looks like this:</ p >
63- < pre > < code class ="php "> {%- filter escape -%}use Symfony\Component\HttpFoundation\Request;
64- use Symfony\Component\HttpKernel\HttpKernelInterface;
65-
66- class YoloMiddleware implements HttpKernelInterface
67- {
68- protected $app;
69-
70- public function __construct(HttpKernelInterface $app)
71- {
72- $this-> app = $app;
73- }
74-
75- public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
76- {
77- $response = $this-> app-> handle($request, $type, $catch);
78- $response-> setContent($response-> getContent() . "< h1 > YOLO!</ h1 > ");
79-
80- return $response;
81- }
82- }{%- endfilter -%}</ code > </ pre >
8361</ div >
8462
8563< hr >
You can’t perform that action at this time.
0 commit comments