Skip to content

Commit b6fecff

Browse files
committed
Bump font size, add middleware example code
1 parent 34e4556 commit b6fecff

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

source/css/style.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
body {
2+
font-size: 18px;
3+
}
4+
5+
p {
6+
line-height: 1.4;
7+
margin: 0 0 1em;
8+
}
9+
10+
code {
11+
font-size: 17px;
12+
}
13+
14+
li {
15+
margin: 0 0 5px;
16+
}
17+
118
.jumbotron {
219
text-align: center;
320
margin: 2em 0;

source/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ <h2>Conventions</h2>
7575
<li>Take the decorated app as the first constructor argument</li>
7676
<li>Decorate the handle call, delegate to the decorated app</li>
7777
</ul>
78+
79+
<p>A simple middleware could look like this:</p>
80+
<pre><code class="php">use Symfony\Component\HttpFoundation\Request;
81+
use Symfony\Component\HttpKernel\HttpKernelInterface;
82+
83+
class MyMiddleware implements HttpKernelInterface
84+
{
85+
protected $app;
86+
87+
public function __construct(HttpKernelInterface $app)
88+
{
89+
$this-&gt;app = $app;
90+
}
91+
92+
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
93+
{
94+
$response = $this-&gt;app-&gt;handle($request, $type, $catch);
95+
$response-&gt;setContent($response-&gt;getContent() . "YOLO!");
96+
97+
return $response;
98+
}
99+
}</code></pre>
100+
78101
<p>
79102
Yes, leveraging the HTTP abstraction is that easy!
80103
</p>

0 commit comments

Comments
 (0)