• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I do not want to allow access to a controller by url

hi evryone
I do not want to allow access to a controller by url
how can i do

Don't have an index function and prefix all your functions with an underscore.

i don't understand ??

it's all in the manual:

the index() method is what CI will load if no method is specified in the url
eg http://example.com/my_app/blog
will execute the index method in the blog controller.

if there is no index method for the blog controller a '404 not found' error will be shown.

also prefixing your methods with an underscore means that they are private and not accessible by url.

If you don't want access to the controller via the URL, what are you going to do with that controller then? Because in stock CI, you can't use controllers internally...

If its a specific controller like only for an admin then check to see if the logged in user is an admin if not redirect them back to the home page!


[eluser]Nur Cholikul Anwar[/eluser]
Maybe you need a authentication programe

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.