Welcome Guest, Not a member yet? Register   Sign In
Deny dirrect access to a controller...
#5

[eluser]kyleect[/eluser]
I notice a lot of people who post CI code use syntax that's friendly to PHP4, esp controllers. Why not declare that controller method private rather than using an underscore? I also noticed that a lot of people don't declare class variables as public/private but use PHP4 syntax. I know the CI framework does this for compatibility but are there really that many people out there that are either running php4 or only know php through CI?

Regarding the question, setting this:

Code:
private function index(){}

will prevent people from accessing the controller. You need to declare every method private if you don't want them to access any of it.


Messages In This Thread
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 11:46 AM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 11:58 AM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 12:09 PM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 12:38 PM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 12:44 PM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 01:02 PM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 01:11 PM
Deny dirrect access to a controller... - by El Forum - 02-05-2009, 02:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB