Welcome Guest, Not a member yet? Register   Sign In
How to block execution of controller
#1

Hi!
I wanna make a rest api using codeigniter. So i create new core element MY_Controller which extend CI_Controller. I make simple annotation parser but now i have a problem. How i can block execution if http method from annotation doesnt match request http method?
I don't wanna use die(), im not a animal Big Grin
Below an example:
GET user/add

Method in controller/User.php:


PHP Code:
/**
 * @Post
 */
public function add() {
    ....


In that case i don't have method for GET request so i must block that (return error), but how i can do it?

Best regards
NickOver
Reply


Messages In This Thread
How to block execution of controller - by NickOver - 06-08-2017, 01:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB