CHAPTER 4
■
BUILD AN EVENTS CALENDAR
149
To complete steps 6-10—actually
build the dates; check if the week needs to wrap;
assemble the
date markup; finish the last week out with filler, and return the markup—add the following bold code:
public function buildCalendar()
{
/*
* Determine the calendar month and create an array of
* weekday abbreviations to label the calendar columns
*/
$cal_month = date('F Y', strtotime($this->_useDate));
$weekdays = array('Sun', 'Mon', 'Tue',
'Wed', 'Thu', 'Fri', 'Sat');
/*
* Add a header to the calendar markup
*/
$html = "\n\tDo'stlaringiz bilan baham: