Welcome Guest, Not a member yet? Register   Sign In
DRY approach with different request type

(This post was last modified: 10-18-2016, 06:44 AM by dave friend.)

Assuming you always want to reject AJAX requests this should work.
It responds to any AJAX request with an "Internal Server Error"

PHP Code:
function check_failed()
set_header("Content-Type: text/plain")
set_output("Internal Server Error")
redirect(); // or show_404

And you will be much more DRY by putting this in a "base" controller that will be extended by the "Class#" controllers.

Messages In This Thread
RE: DRY approach with different request type - by dave friend - 10-18-2016, 06:43 AM

Theme © iAndrew 2016 - Forum software by © MyBB