Welcome Guest, Not a member yet? Register   Sign In
Multiple Custom 404
#4

(07-16-2021, 08:37 AM)paulbalandan Wrote: I'm not sure if I get your situation correctly. Do you want to throw an exception when a certain page is accessed in the browser? So, for example, if a user accesses the /image page defined by the Image controller you want to throw a 404 error?
PHP Code:
public function index()
{
    throw ImageException::forPageNotFound();

Hi, thanks for the reply.
I managed to solve this, but the question was 'is there a way to return 404 error code with a custom view in the body response'.

I no longer need an anwser with this question, I complete it manually using the response class.
Actually learning CodeIgniter4 and creating a complex CMS system for fan-translations teams (Kagescan)
@LoganTann on GitHub // French // He-Him
Reply


Messages In This Thread
Multiple Custom 404 - by ShinProg - 07-16-2021, 07:50 AM
RE: Multiple Custom 404 - by paulbalandan - 07-16-2021, 08:37 AM
RE: Multiple Custom 404 - by ShinProg - 11-21-2021, 05:43 AM
RE: Multiple Custom 404 - by auraheaton - 08-10-2021, 03:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB