request-model
request-model copied to clipboard
It might be convenient to see to already hydrated request model not doing `dd()` or using Xdebug.
There was an idea to create a class of some RequestForm/FormRequest, that works only with POST data.
```php namespace Yiisoft\RequestModel; final class RequestModelFactory { private function getRequestData(ServerRequestInterface $request): array { return [ 'query' => $request->getQueryParams(), 'body' => $request->getParsedBody(), 'attributes' => $request->getAttributes(), 'headers' => $request->getHeaders(), 'files' => $request->getUploadedFiles(),...
https://github.com/yiisoft/request-model#general-usage The middleware example is incorrect
Hi, I would like to format the error message with runtime Yii translator, a [middleware](https://github.com/razonyang/yii-translator-middleware) that store the translator instance into request `attributes`, according to the `Accept-Language` header or URL...
It would be nice to add transformers that should transform the request body before validation. ```php public function setRequestData(array $requestData): void { $this->requestData = $this->doTransform($requestData); } ```
| Q | A | ------------- | --- | Is bugfix? | ❌ | New feature? | ✔️ | Breaks BC? | ✔️ | Fixed issues | #15
It is difficult to work with optional fields. Has two algorithm. For example, field `sort` optional and maybe "asc" or "desc". **Strict algorithm** If data has field (even empty), then...