Nifty Monthly Calendar Class
Recently I had to build a monthly calendar that could be outputted via a templating engine (notably Smarty). I had a brief look around the web, but couldn’t find anything that was light weight and could be used via a templating engine. So I decided to build my own.
I have created a demo for you to have a look at, which you can find here and you can also download a zip file of the source.
What I tried to do as much as possible with this class is to keep all the complex processing out of the template engine. As such I have created a class which collates an array of "Days". Each of these "Days" not only have information on the day, but also instruction to the template, eg "I am at the end of the week" etc, so a new week (eg row of table cells) can be started. No processing going on in the template, just a quick call along the lines of "if start of week then start new row"
Play with, download and enjoy, and if I have time I’ll write up a tutorial!
Leave a Reply
You must be logged in to post a comment.
