Skip to content

Commit

Permalink
moved the Context::fromRequest() code to the Framework class
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 21, 2012
1 parent 111cac0 commit 8399581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion book/part07.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Move the request handling logic into its own ``Simplex\\Framework`` class::

public function handle(Request $request)
{
$this->matcher->getContext()->fromRequest($request);

try {
$request->attributes->add($this->matcher->match($request->getPathInfo()));

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

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

Expand Down
2 changes: 2 additions & 0 deletions book/part09.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ the Response instance::

public function handle(Request $request)
{
$this->matcher->getContext()->fromRequest($request);

try {
$request->attributes->add($this->matcher->match($request->getPathInfo()));

Expand Down

0 comments on commit 8399581

Please sign in to comment.