Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
harikt committed Jan 27, 2015
2 parents 61ad1b3 + 3c57739 commit e8d541c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Configure your routes.
```php
<?php
// config/routes.php
$router = $di->get('router');
$router->add('home', '/')
->addValues(array('controller' => 'homepage'));

Expand All @@ -41,6 +42,7 @@ Time to configure your controller according to the route.
```php
<?php
// config/controllers.php
$dispatcher = $di->get('dispatcher');
$dispatcher->setObject('homepage', function ($response) {
return $response->getBody()->write("<p>Home page in html. Please <a href=\"blog\">Browse</a> and <a href=\"blog/12\">view post</a></p>")->withHeader('Content-Type', 'text/html');
});
Expand Down
5 changes: 3 additions & 2 deletions src/Conduit/Middleware/RouterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public function __construct(Router $router, Dispatcher $dispatcher)

public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
$path = $request->getUri()->getPath();
$route = $this->router->match($path, $request->getServerParams());
$server = $request->getServerParams();
$path = parse_url($server['REQUEST_URI'], PHP_URL_PATH);
$route = $this->router->match($path, $server);
if (! $route) {
return $next($request, $response);
}
Expand Down
2 changes: 1 addition & 1 deletion templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<li><a href="/">Home</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/contact">Contact</a></li>
<li><a href="/admin/">Admin route</a></li>
<li><a href="/admin">Admin route</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
</div><!-- /.nav-collapse -->
Expand Down

0 comments on commit e8d541c

Please sign in to comment.