Welcome Guest, Not a member yet? Register   Sign In
MY_ prefixed classes -- reason for the prefix?
#4

[eluser]jedd[/eluser]
[quote author="philpem" date="1255957573"]
I've got an application that extends the Controller class as MY_Controller to provide authentication functionality for the various functions. Basically, if a class extends MY_Controller, then you can't access it unless you have logged in, your session is valid (i.e. not timed out), and so forth.
[/quote]

You might have an easier time of it if you just change your code (in MY_Controller) to distinguish between admin and logged in and not-logged in users. Session data is a good way of accomplishing this.

That way you just need a single extended controller class.


Quote:This got me thinking -- the CodeIgniter docs explain that you have to use the MY_ prefix (or whatever subclass_prefix is set to), but doesn't go into any further detail. Just out of curiosity, why is this necessary?

I presume it's so CI can locate / identify the file fast - without needing to do directory scans, let alone reading class names within each file in there.

Plus, nomenclatures are generally good things in and of themselves.


Messages In This Thread
MY_ prefixed classes -- reason for the prefix? - by El Forum - 10-19-2009, 02:06 AM
MY_ prefixed classes -- reason for the prefix? - by El Forum - 10-19-2009, 02:44 AM
MY_ prefixed classes -- reason for the prefix? - by El Forum - 10-19-2009, 03:56 AM
MY_ prefixed classes -- reason for the prefix? - by El Forum - 10-19-2009, 03:59 AM
MY_ prefixed classes -- reason for the prefix? - by El Forum - 10-19-2009, 10:00 AM
MY_ prefixed classes -- reason for the prefix? - by El Forum - 10-19-2009, 11:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB