I have a calendar class which outputs a HTML table with a table cell representing a day of the month, however should I be embedding HTML into a class file. My concern is that if I ever have to amend the HTML (i.e add an ID to an element), then I would have to adjust the class file.
I currently dont use the MVC pattern in my project so having a view is not an option.
My cut down class files is as follows (for this example I have assumed that 1 month is 4 weeks):
class calendar {
function __construct(){
}
function output() {
print "<table>";
for ($week=0; $week < 4; $week++) {
print "<tr>";
for ($day=0; $day < 7; $day++) {
print "<td></td>";
}
print "</tr>";
}
print "</table>";
}
Are there any other methods which I haven't thought about which would keep the HTML separate from the class file Thanks in advance