Skip to content

Commit 5227bff

Browse files
authored
Merge pull request #88 from einorler/docs
added minor changes to the documentation
2 parents 7a3cad7 + 97275dc commit 5227bff

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ ongr_router:
9191

9292
> WARNING: If SeoAwareTrait is used you must implement `urlAnalyzer` analyzer, otherwise there will be a fatal error on index create.
9393
94+
In the configuration of the bundle you need to specify the `es.manager` to use and under the `seo_routes` you have to specify documents that will have seo_routes as keys and the controller action that will handle the request as a values.
95+
9496
At `_controller` you define controller and action for every document type.
9597
`_route` is a name of this route and it can be used at path generation.
9698

@@ -112,11 +114,12 @@ namespace AppBundle\Document;
112114

113115
use ONGR\ElasticsearchBundle\Annotation as ES;
114116
use ONGR\RouterBundle\Document\SeoAwareTrait;
117+
use ONGR\RouterBundle\Document\SeoAwareInterface;
115118

116119
/**
117120
* @ES\Document()
118121
*/
119-
class Product
122+
class Product implements SeoAwareInterface
120123
{
121124
use SeoAwareTrait; // <- Trait for URL's
122125

Resources/doc/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Welcome to the RouterBundle, the part of ONGR bundles family, which helps to hav
88

99
### URL generation
1010

11-
When your document uses [SeoAwareTrait](https://github.com/ongr-io/RouterBundle/blob/master/Document/SeoAwareTrait.php) you have protected property called `$url`. It contains the url for specific document,
11+
When your document uses [SeoAwareTrait](https://github.com/ongr-io/RouterBundle/blob/master/Document/SeoAwareTrait.php) you have protected property called `$url`. It contains the url for specific document,which is used for url generation.
1212

13-
which is used for url generation. Your document also needs to implement [SeoAwareInterface](https://github.com/ongr-io/RouterBundle/blob/master/Document/SeoAwareInterface.php)
13+
Your document must be defined in the configuration of the bundle, under the node `seo_routes`. There you will define the bundle, controller and action that will be called after the router matches the route in your document.
14+
15+
Don't forget that your document also needs to implement [SeoAwareInterface](https://github.com/ongr-io/RouterBundle/blob/master/Document/SeoAwareInterface.php) in order to be used by the ONGR router.
1416

1517
Let's say we have following document:
1618

0 commit comments

Comments
 (0)