From 6e4eb3ba4f55cc6ed8d2a4e9181aabff8d333042 Mon Sep 17 00:00:00 2001 From: PJ Dietz Date: Sun, 27 Jul 2014 17:10:46 -0400 Subject: [PATCH] Fix links in documentation --- documentation/changes-from-version-1.md | 4 ++-- documentation/handler-interface.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/documentation/changes-from-version-1.md b/documentation/changes-from-version-1.md index 684dac3..6e8b3d3 100644 --- a/documentation/changes-from-version-1.md +++ b/documentation/changes-from-version-1.md @@ -55,13 +55,13 @@ See [Routes](routes.md) for more information. ## Interfaces I whittled the number of interfaces down to three: -- [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HanderInterface.php) +- [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php) - [`RequestInterface`](../src/pjdietz/WellRESTed/Interfaces/RequestInterface.php) - [`ResponseInterface`](../src/pjdietz/WellRESTed/Interfaces/ResponseInterface.php) (`RoutableInterface`, `RouteInterface`, `RouteTargetInterface`, `RouterInterface` are all removed.) -Version 2's design is centered around [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HanderInterface.php). This new approach both simplifies the API, but also adds a great deal of flexibility. +Version 2's design is centered around [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php). This new approach both simplifies the API, but also adds a great deal of flexibility. See [HandlerInterface](handler-interface.md) to learn more. diff --git a/documentation/handler-interface.md b/documentation/handler-interface.md index 0b4a2c0..66c3b8a 100644 --- a/documentation/handler-interface.md +++ b/documentation/handler-interface.md @@ -1,6 +1,6 @@ # HandlerInterface -Much of WellRESTed 2 centers around the [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HanderInterface.php) which has only one method that you need to implement: +Much of WellRESTed 2 centers around the [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php) which has only one method that you need to implement: ```php /** @@ -36,7 +36,7 @@ $router->respond(); ### But there's no route? -Here's the cool thing about how routing works in WellRESTed 2: The route classes implement [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HanderInterface.php). When the `Router` iterates through its list of routes, it calls `getResponse()` on each one until it gets a non-`null` return value. At this point, it returns that response (or outputs it in the case of `Router::respond()`). +Here's the cool thing about how routing works in WellRESTed 2: The route classes implement [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php). When the `Router` iterates through its list of routes, it calls `getResponse()` on each one until it gets a non-`null` return value. At this point, it returns that response (or outputs it in the case of `Router::respond()`). Each time the router calls `getResponse()` on a route that doesn't match request, the route returns `null` to indicate that something else will need to handle this. @@ -68,7 +68,7 @@ If none of the routes in a router return a non-`null` value, what happens? If you're calling `Router::respond()`, you will **always** get a response. `Router::respond()` is a shorthand method that will output the response made in `Router::getNoRouteResponse()` if it gets through its entire route table and finds no matches. -If you want to customize the default 404 response, you can either subclass `Router` and redefine `Router::getNoRouteResponse()`, or you can create a [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HanderInterface.php) like our `HelloWorldHandler` that always returns a response with a `404 Not Found` status code and add it to the router **last**. (Remember: a router evaluates its routes in the order you add them.) +If you want to customize the default 404 response, you can either subclass `Router` and redefine `Router::getNoRouteResponse()`, or you can create a [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php) like our `HelloWorldHandler` that always returns a response with a `404 Not Found` status code and add it to the router **last**. (Remember: a router evaluates its routes in the order you add them.) ```php class NotFoundHandler implements HandlerInterface @@ -93,7 +93,7 @@ $router->respond(); ## Nested Routers -`Router::respond()` is a shorthand method that wraps `Router::getResponse()`, which [`Router`](../src/pjdietz/WellRESTed/Router.php) must have because it too implements [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HanderInterface.php). This means that you can break your router into subrouters. +`Router::respond()` is a shorthand method that wraps `Router::getResponse()`, which [`Router`](../src/pjdietz/WellRESTed/Router.php) must have because it too implements [`HandlerInterface`](../src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php). This means that you can break your router into subrouters. ```php