Just when I think I've done something in the best way possible, a UFie teaches me something new.
Thanks for including that last paragraph. Now I get to go rewrite code. At least this time I only have to rewrite one little block of code in one page instead of a large block of code on every page, so my site rewrite last year did pay off.
I had went from a bunch of IF statements on every page (copy&paste is not your friend) to a few switch/case scenarios in an include file. Using an array to compare against is just too intelligent for me to think of on my own. YES, I'm comfortable with arrays, I can create them, step through them, sort them, add to them, subtract from them, etc. without looking in the manual, but, I never once thought to use an array with my menu/page code.
Switching my SWITCH code for an array will not only reduce my codebase even more, it will make additions and subtractions to my menu/page handling code super simple.
*Thanks a bunch* I love it when I learn something new or a newer easier way to do what I do.
That is one problem with learning to code on your own. You spend so much time stumbling around that once you finally get something to work, no matter how wrong the method is, it is good. While I won't have a large reduction in code this time around, the code block will go from proper to expert. ...again, thank you. You have opened my eyes to a new method for doing what I do and I like it. :) |