Update README.md

This commit is contained in:
William Durand 2013-04-18 01:29:56 +03:00
parent 08eebf0fa0
commit 3c43cc5d07

View File

@ -226,9 +226,9 @@ input is used, so you can configure their priorities via container tags. Here's
#app/config/config.yml #app/config/config.yml
services: services:
mybundle.api_doc.extractor.custom_parser: mybundle.api_doc.extractor.custom_parser:
class: MyBundle\Parser\CustomDocParser; class: MyBundle\Parser\CustomDocParser
tags: tags:
- {name: nelmio_api_doc.extractor.parser, priority: 2} - { name: nelmio_api_doc.extractor.parser, priority: 2 }
You can also define your own motd content (above methods list). All you have to do is add to configuration: You can also define your own motd content (above methods list). All you have to do is add to configuration:
@ -236,20 +236,20 @@ You can also define your own motd content (above methods list). All you have to
motd: motd:
template: AcmeApiBundle::Components/motd.html.twig template: AcmeApiBundle::Components/motd.html.twig
## Using your own annotations ## ## Using Your Own Annotations ##
If you have developped your own project-related annotations, and you want to parse them to populate the ApiDoc, If you have developed your own project-related annotations, and you want to parse them to populate
you can provide custom handlers as services. You juste have to implements the the `ApiDoc`, you can provide custom handlers as services. You juste have to implement the
`Nelmio\ApiDocBundle\Extractor\HandlerInterface` and tag it as `nelmio_api_doc.extractor.handler`. `Nelmio\ApiDocBundle\Extractor\HandlerInterface` and tag it as `nelmio_api_doc.extractor.handler`:
#app/config/config.yml # app/config/config.yml
services: services:
mybundle.api_doc.extractor.my_annotation_handler: mybundle.api_doc.extractor.my_annotation_handler:
class: MyBundle\AnnotationHandler\MyAnnotationHandler; class: MyBundle\AnnotationHandler\MyAnnotationHandler
tags: tags:
- {name: nelmio_api_doc.extractor.handler} - { name: nelmio_api_doc.extractor.handler }
Look at examples in [Handlers](https://github.com/nelmio/NelmioApiDocBundle/tree/annotation_handlers/Extractor/Handler) Look at the built-in [Handlers](https://github.com/nelmio/NelmioApiDocBundle/tree/master/Extractor/Handler).
## Credits ## ## Credits ##