PathArgs final class
Minn\Rest\PathArgs · public/minn/src/Minn/Rest/PathArgs.php · 79 lines
The arguments a route's path names, as the reference lists them among the route's args: each capture again, described and typed. Declared, they are judged like any other argument, and a value of the same name in the query (or a write's body) takes the capture's place before the caller is judged (Http\Router), as on the reference: /wp/v2/users/1?id=abc is refused as an invalid id, and /wp/v2/users/1?id=2 answers user 2. A route lists one only where the reference lists it (a widget's GET names no id), and in the reference's order, which a refusal's list follows.
Used by 17 (show)
Constants and properties
| const | USER_ID = array ( 'id' => array ( 'description' => 'Unique identifier for the user.', 'type' => 'integer', 'required' => false, ), ) | A user's id: wp/v2/users/{id}. |
| const | POST_ID = array ( 'id' => array ( 'description' => 'Unique identifier for the post.', 'type' => 'integer', 'required' => false, ), ) | A post's id: wp/v2/{type base}/{id}, media, blocks, navigation, menu items. |
| const | COMMENT_ID = array ( 'id' => array ( 'description' => 'Unique identifier for the comment.', 'type' => 'integer', 'required' => false, ), ) | A comment's id: wp/v2/comments/{id}. |
| const | GLOBAL_STYLES_ID = array ( 'id' => array ( 'description' => 'ID of global styles config.', 'type' => 'integer', 'required' => false, ), ) | A global styles config's id: wp/v2/global-styles/{id}, read (its writes name none). |
| const | THEME_STYLES = array ( 'stylesheet' => array ( 'description' => 'The theme identifier', 'type' => 'string', 'required' => false, 'handler_validates' => true, ), ) | A theme's identifier: wp/v2/global-styles/themes/{stylesheet} and its variations. The handler judges it: the reference holds it to no type. |
| const | TERM_ID = array ( 'id' => array ( 'description' => 'Unique identifier for the term.', 'type' => 'integer', 'required' => false, ), ) | A term's id: wp/v2/{taxonomy base}/{id}, and a menu's. |
| const | STATUS = array ( 'status' => array ( 'description' => 'An alphanumeric identifier for the status.', 'type' => 'string', 'required' => false, ), ) | A post status's name: wp/v2/statuses/{status}. |
| const | RENDERED_BLOCK = array ( 'name' => array ( 'description' => 'Unique registered name for the block.', 'type' => 'string', 'required' => false, ), ) | The block a render asks for: wp/v2/block-renderer/{name}. |
| const | BLOCK_NAMESPACE = array ( 'namespace' => array ( 'description' => 'Block namespace.', 'type' => 'string', 'required' => false, ), ) | A block type's namespace: wp/v2/block-types/{namespace}. |
| const | BLOCK_NAME = array ( 'name' => array ( 'description' => 'Block name.', 'type' => 'string', 'required' => false, ), ) | A block type's name within its namespace: wp/v2/block-types/{namespace}/{name}. |
| const | STYLESHEET = array ( 'stylesheet' => array ( 'description' => 'The theme\'s stylesheet. This uniquely identifies the theme.', 'type' => 'string', 'required' => false, ), ) | A theme's stylesheet: wp/v2/themes/{stylesheet}. |
| const | PLUGIN = array ( 'plugin' => array ( 'type' => 'string', 'pattern' => '[^.\\/]+(?:\\/[^.\\/]+)?', 'required' => false, 'bare_refusal' => true, ), ) | A plugin's file without its .php: wp/v2/plugins/{plugin}. The reference gives it no description and judges it with a check of its own, whose refusal is the bare "Invalid parameter.". |
| const | SIDEBAR_ID = array ( 'id' => array ( 'description' => 'The id of a registered sidebar', 'type' => 'string', 'required' => false, ), ) | A registered sidebar's id: wp/v2/sidebars/{id}. |
| const | WIDGET_TYPE_ID = array ( 'id' => array ( 'description' => 'The widget type id.', 'type' => 'string', 'required' => false, ), ) | A widget type's id: wp/v2/widget-types/{id}. |
Nothing matches.