Welcome Guest, Not a member yet? Register   Sign In
Centralizing user-defined error.
#2

The strings for the error messages should really be loaded from a lang file so they can be localized, if necessary, or, at least, be available in one location which can be easily updated by people with a fairly limited knowledge of PHP code.

Generally, I would use MY_Model (or whatever prefix is defined for your application) for the base class name, because people familiar with CodeIgniter will tend to look there, first, for your base model, but I've certainly had situations in which I've needed to use other base models. It works out fine as long as people are careful in their troubleshooting/debugging and you don't duplicate functionality in multiple base models.

I would also avoid names like baseClass2 in favor of something more descriptive, but I'm hoping that was just an example. It may be easy in the short term to have baseClass, baseClass2, baseClass3, but, in the long run, or when someone else has to deal with the code, someone will have to look at the code to figure out what the difference is between the classes, where a better name might prevent some confusion.
Reply


Messages In This Thread
RE: Centralizing user-defined error. - by mwhitney - 06-22-2015, 07:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB