Welcome Guest, Not a member yet? Register   Sign In
Restrict controller method to a POST or GET request ?
#1

[eluser]Rushino[/eluser]
Hello,

It is possible to restrict a controller method to a post or get request ?

Thanks.
#2

[eluser]danmontgomery[/eluser]
Code:
function my_function() {
    if(empty($_POST) && empty($_GET))
        redirect('somewhere/else');

    // ...
}
#3

[eluser]Rushino[/eluser]
Thanks. I used the input class instead.




Theme © iAndrew 2016 - Forum software by © MyBB