We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello How to add custom headers to response?
config:
fos_rest: body_listener: true format_listener: rules: - { path: '^/api', priorities: ['json'], fallback_format: json, prefer_extension: false } - { path: '^/user', priorities: ['text/html'], fallback_format: 'text/html', prefer_extension: false } param_fetcher_listener: true view: view_response_listener: 'force' formats: json: true
I have in controller
/** * @Rest\Get("/", name="index",) * @param UserRepository $userRepository * @return array */ public function index(UserRepository $userRepository): array { $users = $userRepository->findAll(); return $users; }
Now I need to add custome header X-Total-Count as count($users). How to do it with FOSRestBundle?
X-Total-Count
The text was updated successfully, but these errors were encountered:
Hello,
You can create a view_handler
view_handler
Sorry, something went wrong.
No branches or pull requests
Hello
How to add custom headers to response?
config:
I have in controller
Now I need to add custome header
X-Total-Count
as count($users). How to do it with FOSRestBundle?The text was updated successfully, but these errors were encountered: