A PHP Calendar Class Based on Zend_Date
Posted on : 26-05-2009 | By : Derek | In : PHP, Posts, Zend
Tags: coding, CSS, custom calendar, demo, event solutions, localization, open source, zend framework
14
A recent project required an event calendar in both a mini and full sized format. The project was based on Zend Framework, a highly scalable and feature-rich PHP MVC framework. The resulting Calendar class is admittedly quite basic, but I thought it might prove useful for other PHP/Zend coders who are trying to find a simple yet extensible Calendar solution for their own projects.
Localization
The benefit of using Zend_Date is that it relies on Zend_Locale for localization. To promote this, this custom Calendar class can be used to create a calendar in any language via the class constructor’s ‘locale’ parameter.
Features
- It can output HTML in the form of a table with the month, days of the week, and days visible.
- It can generate the calendar HTML header alone, or the calendar HTML table body alone.
- It can also be used to generate previous and next month links in the case you wanted to allow users to select the month themselves.
- There is control over the table css, select box css , and select box form name via the html methods parameters
- The class can also be used to generate Calendar data that you can access via more standard (get and set) methods to support your own unique Calendaring needs, i.e. without relying on HTML output.
Demo
Here is a link to a demo to get you started.
Downloads
- Download the code here: CalendarClassPhp (336)
- Comment below and let me know if it met your needs!

