I looking to create a custom calender with Zend Framework, I am hoping that it will be able to list all the days of the month for the coming years and then have a different bg color on the date if there is an event on this. I am however struggling to create this firstly because it needs to go into the layout view, rather than an action, so where does the logic go? I am also unclear as to how the logic with mkdate() would work.
Can someone point me in the right direct please?
Thanks
I've ran into a similar problem so I created a calendar for the Zend Framework. It uses Zend_Date and Zend_Locale as well as a view script for rendering. More info can be found at http://www.spiffyjr.me
Here is a simple Calendar class that uses Zend_Date and Zend_Locale that you can use as a starting point:
www.arietis-software.com/index.php/2009/05/26/a-php-calendar-class-based-on-zend_date/
I've created and embedded a calendar in a similar why to which you are describing. My approach was to implement the calendar as a view helper.
The helper, was called
My_View_Helper_Calendar
and has to contain a public method calledcalendar
which I have returning an instance of the helper, like so:As indicated, I set up some private methods within the view helper to do the calendar building, and had another public method called
toHtml
which renders the calendar as HTML.That way, calling the helper from the context of a view file is as easy as:
Hope this helps you get on the right track.