Restrict access to MY_Controller functions |
[eluser]dynZack[/eluser]
How do you restrict access in certain functions defined within MY_Controller? For example: Code: class MX_Controller extends Controller Going to http://www.example.com/set_cookies outputs a blank page and not a 403 error. How to make sure that access is forbidden, output a message and redirect to home page?
[eluser]mddd[/eluser]
If you want a controller method to never be available to the public (that is: you can only call it from within your own code) you can start the name with a _. CI will not make the method available to be called from the URI. Note: this has nothing to do with being in a controller or in MY_Controller. Like this: Code: function _set_cookies()
|
Welcome Guest, Not a member yet? Register Sign In |