ExeptionHandler use API trait |
When using an HTMX query, I create a 404 error from PageNotFoundException. At the same time, instead of an HTML response, I get JSON.
Is this how it's planned or am I doing something wrong? PHP Code: public function show(int $id) Request: Code: POST /notification/show/111 HTTP/1.1 Response: Code: HTTP/1.1 404 Not Found
Simple CI 4 project for beginners codeigniter-expenses
This is not a bug. Because you accept application/json:
Code: Accept: */*
But in normal mode, HTMX always sends */* and we return HTML to it from the controller
Simple CI 4 project for beginners codeigniter-expenses
Problem solved:
Code: <body class="app" hx-headers='{"Accept":"text/html"}'></body>
Simple CI 4 project for beginners codeigniter-expenses
|
Welcome Guest, Not a member yet? Register Sign In |