@@ -85,24 +85,28 @@ The component already provides some general purpose enhancers. They all follow
85
85
the principle to never change an existing field but only add fields if they
86
86
do not exist yet:
87
87
88
- * ``RouteContentEnhancer ``: If the route is an instance of ``RouteObjectInterface ``,
89
- this enhancer sets the target field to the return value of ``getContent() ``.
90
- * ``FieldMapEnhancer ``: Configured with a key-value map. If a specified field of
91
- the match contains a key, the target field is set to the value.
92
- * ``FieldByClassEnhancer ``: Configured with a map of class names to values.
93
- If the specified field contains an object that is an instance of a class in
94
- the map, sets the target field to the corresponding value. Note that the
95
- first match is taken, should the objects be instance of more than one of the
96
- classes. This enhancer is for example used to determine the controller and
97
- template based on the class of a Content document.
98
- This enhancer is similar to ``FieldMapEnhancer ``, but doing an
99
- :phpfunction: `instanceof ` check rather than string comparison for the map
100
- keys.
101
- * ``FieldPresenceEnhancer ``: If a field is present in the route match, sets an
102
- other field to a specified value if that field is not set yet.
103
- * ``ContentRepositoryEnhancer ``: If the source field is present in the route match,
104
- sets target field to the сontent returned by the ``ContentRepositoryInterface `` with
105
- value of the source field, if target field is not yet set.
88
+ ``RouteContentEnhancer ``
89
+ If the route is an instance of ``RouteObjectInterface ``, this enhancer sets
90
+ the target field to the return value of ``getContent() ``.
91
+ ``FieldMapEnhancer ``
92
+ Configured with a key-value map. If a specified field of the match contains
93
+ a key, the target field is set to the value.
94
+ ``FieldByClassEnhancer ``
95
+ Configured with a map of class names to values. If the specified field
96
+ contains an object that is an instance of a class in the map, sets the
97
+ target field to the corresponding value. Note that the first match is
98
+ taken, should the objects be instance of more than one of the classes. This
99
+ enhancer is for example used to determine the controller and template based
100
+ on the class of a Content document. This enhancer is similar to
101
+ ``FieldMapEnhancer ``, but doing an :phpfunction: `instanceof ` check rather
102
+ than string comparison for the map keys.
103
+ ``FieldPresenceEnhancer ``
104
+ If a field is present in the route match, sets an other field to a
105
+ specified value if that field is not set yet.
106
+ ``ContentRepositoryEnhancer ``
107
+ If the source field is present in the route match, sets target field to the
108
+ content returned by the ``ContentRepositoryInterface `` with value of the
109
+ source field, if target field is not yet set.
106
110
107
111
You can also create your own route enhancer by creating a class which
108
112
implements ``Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface ``.
0 commit comments