"be consistent" | |
PerlMonks |
Re^4: Code and html separation - always or mostly doable?by Michalis (Pilgrim) |
on Jun 17, 2004 at 09:28 UTC ( [id://367568]=note: print w/replies, xml ) | Need Help?? |
I thought I'ld let it as an exercise, but...
If I use bgcolor as integer, not boolean, I can easily do that:
So I can not only define classes color1,color2 etc, but if in the future we decide we want a 57th special case we haven't thought of before, we don't need to change any code, we just create a class57 and "feed" the bgcolor with the number 57. As I said before, there is always a matter of good analysis in order to trully and forever seperate perl code (business logic) from presentation (I consider the loops and if/then/else cases in the final HTML pages to be presentation-specific and not business specific)
-- Michalis
In Section
Seekers of Perl Wisdom
|
|