Skip to content

Commit 7af6e62

Browse files
authored
getRoute() is the correct method
1 parent 0c83408 commit 7af6e62

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ This method looks for the "foo" variable. If found, it is returned. If not, th
173173
[Routes](https://docs.platform.sh/configuration/routes.html) on Platform.sh define how a project will handle incoming requests; that primarily means what application container will serve the request, but it also includes cache configuration, TLS settings, etc. Routes may also have an optional ID, which is the preferred way to access them.
174174

175175
```php
176-
$config->route("main");
176+
$config->getRoute("main");
177177
```
178178

179-
The `route()` method takes a single string for the route ID ("main" in this case) and returns the corresponding route array. If the route is not found it will throw an exception.
179+
The `getRoute()` method takes a single string for the route ID ("main" in this case) and returns the corresponding route array. If the route is not found it will throw an exception.
180180

181181
To access all routes, or to search for a route that has no ID, the `routes()` method returns an associative array of routes keyed by their URL. That mirrors the structure of the `PLATFORM_ROUTES` environment variable.
182182

0 commit comments

Comments
 (0)