views:

1361

answers:

6

Hello,

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

A: 

It it just for a view or do are you looking for the logic behind it.

sanders
should be a comment under the original question
rick
A: 

I kind of have an idea of the logic behind it...mkdate() loop through it 31 time each time doing mkdate()....is that correct?

Basically I am unclear on everything. Logic and View

sico87
A: 

Hm... i am also searching for an calendar in Zend Framework... I roughly understood the logic behind it, but i think it is really an enormous amount of work to make a calendar that looks nice, has a good usability and has several features, such as:

  • multiple appointment types
  • different colors for each type
  • different views
  • AJAX support
  • customizable DB access
  • a clear display of the length of an appointment
  • ...

The logic behind is pretty easy i guess... as long as you can tell that there will only be one appointment at the same time... The part that takes most time is the usability and the rendering of the calendar (the view)...

Does anybody know an Calendar that is based on the Zend Framework? There is no need for all features to be supported, they can be added i guess... but it would be nice to have a good base to work with.

Gushiken
+3  A: 

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/

+1  A: 

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 called calendar which I have returning an instance of the helper, like so:

public function calendar()
{
    // Calls to private methods here
    return $this;
}

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:

<?= $this->calendar()->toHtml(); ?>

Hope this helps you get on the right track.

Kieran Hall
A: 

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