-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow generating REST resources by setting a default extension.
This permits writing routes without the need to specify the extension. If no extension is found, the default will be used. If an extension is found, that extension will be used. It is useful when you always want those resources to be identified as a specific type. So after a call like: Router::mapResources(['categories'], ['_ext' => 'json']); Router::parseExtensions('json', 'xml'); the following two will render JSON: http://example.com/categories/1 http://example.com/categories/1.json and http://example.com/categories/1.xml will still be returning XML. If the parseExtension() call is omitted, the non-extension URL: http://example.com/categories/1 will still be rendering JSON.
- Loading branch information
Showing
2 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters