From cc6b4415bcd1b0486aa7aafb1cc9f029ca3b539d Mon Sep 17 00:00:00 2001 From: Davide Pastore Date: Fri, 16 Dec 2016 18:37:54 +0100 Subject: [PATCH] Add index to readme (#21) Closed #20 --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c0f08ce..e60cd7b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,20 @@ A validation library for the Slim Framework. It internally uses [Respect/Validation][respect-validation]. +## Table of contents + +- [Install](#install) +- [Usage](#usage) + - [Register per route](#register-per-route) + - [Register for all routes](#register-for-all-routes) + - [Route parameters](#route-parameters) + - [JSON requests](#json-requests) + - [XML requests](#xml-requests) + - [Translate errors](#translate-errors) +- [Testing](#testing) +- [Contributing](#contributing) +- [Credits](#credits) + ## Install Via Composer @@ -122,7 +136,7 @@ $app->run(); ``` -## Route parameters +### Route parameters ```php use Respect\Validation\Validator as v; @@ -159,7 +173,7 @@ $app->run(); Note that requests parameters take priority over route parameters, so if you use the same name for a route and request parameter, the last will win and it will be considered for validation. -## JSON requests +### JSON requests You can also validate a JSON request. Let's say your body request is: @@ -215,7 +229,7 @@ Array ``` -## XML requests +### XML requests You can also validate a XML request. Let's say your body request is: @@ -274,7 +288,7 @@ Array ``` -## Translate errors +### Translate errors You can provide a callable function to translate the errors.