File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,41 @@ bazinga_geocoder:
129
129
130
130
The `services` key could also be as follows `services : ['@my_geocoder', '@my_geocoder_ii']`. Notice these are the values from the `aliases` key.
131
131
132
+ # ## Autowiring Providers
133
+
134
+ If you're using Symfony 4.3 and autowiring you can use bindings provided
135
+ the bundle.
136
+
137
+ ` ` ` yaml
138
+ bazinga_geocoder:
139
+ providers:
140
+ googleMaps:
141
+ factory: Bazinga\G eocoderBundle\P roviderFactory\G oogleMapsFactory
142
+ ` ` `
143
+
144
+ ` ` ` php
145
+ <?php
146
+
147
+ namespace App\S ervice;
148
+
149
+ use Geocoder\P rovider\P rovider;
150
+
151
+ class MyService
152
+ {
153
+ private $googleMapsGeocoder;
154
+
155
+ public function __construct(Provider $googleMapsGeocoder)
156
+ {
157
+ $this->googleMapsGeocoder = $googleMapsGeocoder;
158
+ }
159
+ }
160
+ ` ` `
161
+
162
+ Each configured provider has a binding in the following format :
163
+ ` providerName + Geocoder` .
164
+
165
+ In the example we configured provider name as `googleMaps` so the argument is `$googleMapsGeocoder`.
166
+
132
167
# ## Fake local ip
133
168
134
169
You can fake your local IP through this bundle in order to get location
You can’t perform that action at this time.
0 commit comments