From e69d50599213313fb24e713fe9b4982d4572785a Mon Sep 17 00:00:00 2001 From: PJ Dietz Date: Sat, 26 Jul 2014 22:45:42 -0400 Subject: [PATCH] Fix links in documentation --- README.md | 6 +++--- documentation/handlers.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 04f79b8..d52f753 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Examples ### Routing -WellRESTed's primary goal is to facilitate mapping of URIs to classes that will provide or accept representations. To do this, create a [`Router`](src/pjdietz/WellRESTed/Router.php) instance and load it up with some routes. Each route is simply a mapping of a URI pattern to a class name. The class name represents the "handler" (any class implementing `HandlerInterface`) which the router will dispatch when it receives a request for the given URI. **The handlers are never instantiated or loaded unless they are needed.** +WellRESTed's primary goal is to facilitate mapping of URIs to classes that will provide or accept representations. To do this, create a [`Router`](src/pjdietz/WellRESTed/Router.php) instance and load it up with some routes. Each route is simply a mapping of a URI pattern to a class name. The class name represents the "handler" (any class implementing [`HandlerInterface`](src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php) ) which the router will dispatch when it receives a request for the given URI. **The handlers are never instantiated or loaded unless they are needed.** ```php // Build the router. @@ -93,7 +93,7 @@ Notice that when you build routes through JSON, you can provide a `handlerNamesp ### Handlers -Any class that implements [`HandlerInterface`](src/pjdietz/WellRESTed/Interface/HandlerInterface.php) may be the handler for a route. This could be a class that builds the actual response, or it could another [`Router`](src/pjdietz/WellRESTed/Router.php). +Any class that implements [`HandlerInterface`](src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php) may be the handler for a route. This could be a class that builds the actual response, or it could another [`Router`](src/pjdietz/WellRESTed/Router.php). For most cases, you'll want to use a subclass of the [`Handler`](src/pjdietz/WellRESTed/Handler.php) class, which provides methods for responding based on HTTP method. When you create your [`Handler`](src/pjdietz/WellRESTed/Handler.php) subclass, you will implement a method for each HTTP verb you would like the endpoint to support. For example, if `/cats/` should support `GET`, you would override the `get()` method. For `POST`, `post()`, etc. @@ -127,7 +127,7 @@ class CatsCollectionHandler extends \pjdietz\WellRESTed\Handler } ``` -See [Handlers](documentation/handler.md) to learn about the various route classes. +See [Handlers](documentation/handlers.md) to learn about the various route classes. ### Responses diff --git a/documentation/handlers.md b/documentation/handlers.md index 83bc853..490a1fd 100644 --- a/documentation/handlers.md +++ b/documentation/handlers.md @@ -91,9 +91,9 @@ protected function buildResponse() ## HttpExceptions -Another useful feature of the [`Handler`](../src/pjdietz/WellRESTed/Handler.php) class is that it catches exceptions deriving from [`HttpException`](../src/pjdietz/WellRESTed/Exceptions/HttpExceptions) and turns them into responses. +Another useful feature of the [`Handler`](../src/pjdietz/WellRESTed/Handler.php) class is that it catches exceptions deriving from [`HttpException`](../src/pjdietz/WellRESTed/Exceptions/HttpExceptions.php) and turns them into responses. -[`HttpException`](../src/pjdietz/WellRESTed/Exceptions/HttpExceptions) and its subclasses provide the status code and description for simple error responses. +[`HttpException`](../src/pjdietz/WellRESTed/Exceptions/HttpExceptions.php) and its subclasses provide the status code and description for simple error responses. For example, you can throw a `NotFountException` if the resource the request indicates does not exist. @@ -121,7 +121,7 @@ class CatsCollectionHandler extends Handler Your [`Handler`](../src/pjdietz/WellRESTed/Handler.php) will automatically turn this into a `404 Not Found` response. -Here are the available `HttpException` classes: +Here are the available [`HttpException`](../src/pjdietz/WellRESTed/Exceptions/HttpExceptions.php) classes: Response Code | Class --------------------------- | -----------------------