Skip to content
Advertisement

redirect to 404 page instead of Fatal error: Uncaught ArgumentCountError: Too few arguments to function

I made an MVC framework for training, and I get this error and I’m not sure what is wrong with my function.

when I open link like this : http://mvctrav.com/posts/show/6 it show me the post but when deleting the id like this http://mvctrav.com/posts/show/ it shows me the error

My error looks like this:

JavaScript

and my function is :

JavaScript

this is my Core class:

JavaScript

my problem is: link http://mvctrav.com/posts/show to be not found or redirecting to specific page instead of showing the error Thank you for trying to help!

Advertisement

Answer

I think you need to edit show() function to be like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement