$cal_month";
for ( $d=0, $labels=NULL; $d<7; ++$d )
{
$labels .= "\n\t\t" . $weekdays[$d] . "";
}
$html .= "\n\t
. $labels . "\n\t";
/*
* Create the calendar markup
*/
$html .= "\n\t"; // Start a new unordered list
for ( $i=1, $c=1, $t=date('j'), $m=date('m'), $y=date('Y');
$c<=$this->_daysInMonth; ++$i )
{
// More steps go here
}
/*
* Return the markup for output
*/
return $html;
}
Next, add the bold code below to complete steps 3–5:
public function buildCalendar()
{
/*
* Determine the calendar month and create an array of
* weekday abbreviations to label the calendar columns
*/
www.freepdf-books.com
CHAPTER 4
■
BUILD AN EVENTS CALENDAR
148
$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: |