Browse Source

Merge pull request #8430 from cakephp/issue-8419

Add example of inflect option to RouteBuilder::resources()
ADmad 10 years ago
parent
commit
8b7d39236f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/Routing/RouteBuilder.php

+ 8 - 0
src/Routing/RouteBuilder.php

@@ -270,6 +270,14 @@ class RouteBuilder
      * By default the path segment will match the key name. You can use the 'path' key inside the resource
      * definition to customize the path name.
      *
+     * You can use the `inflect` option to change how path segments are generated:
+     *
+     * ```
+     * $routes->resources('PaymentTypes', ['inflect' => 'dasherize']);
+     * ```
+     *
+     * Will generate routes like `/payment-types` instead of `/payment_types`
+     *
      * ### Options:
      *
      * - 'id' - The regular expression fragment to use when matching IDs. By default, matches