Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8399581

Browse files
committed
moved the Context::fromRequest() code to the Framework class
1 parent 111cac0 commit 8399581

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

book/part07.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Move the request handling logic into its own ``Simplex\\Framework`` class::
4242

4343
public function handle(Request $request)
4444
{
45+
$this->matcher->getContext()->fromRequest($request);
46+
4547
try {
4648
$request->attributes->add($this->matcher->match($request->getPathInfo()));
4749

@@ -69,7 +71,6 @@ And update ``example.com/web/front.php`` accordingly::
6971
$routes = include __DIR__.'/../src/app.php';
7072

7173
$context = new Routing\RequestContext();
72-
$context->fromRequest($request);
7374
$matcher = new Routing\Matcher\UrlMatcher($routes, $context);
7475
$resolver = new HttpKernel\Controller\ControllerResolver();
7576

book/part09.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ the Response instance::
7272

7373
public function handle(Request $request)
7474
{
75+
$this->matcher->getContext()->fromRequest($request);
76+
7577
try {
7678
$request->attributes->add($this->matcher->match($request->getPathInfo()));
7779

0 commit comments

Comments
 (0)