webdev007
Programmer
- Sep 9, 2005
- 168
Trying to add a var date instead of hard coded date
// this hard coded format works
$cal->addEvent('example Event 2', 2007, 12, 3, '
// trying to make the date a variable (here is today)
//For test purpose I broke the requested date format in three pieces
// Add event on current day
$b = date("Y").',';
$c = date("m").',';
$d = date("d").',';
$a=$b.$c.$d;
// this is line 28
$cal->addEvent('example Event', $a, ' //echo" $a";
// if I echo the result as $a, then the format is the good one
but some errors comes from the class as follow:
<<<
Warning: Missing argument 4 for calendar::addEvent(),
called in C:\ xxxxx on line 28 and defined in C:\xxxxx cal.class.php on line 155
AND
Warning: Missing argument 5 for calendar::addEvent(),
called in C:\xxxxx on line 28 and defined in C:xxxx cal.class.php on line 155
// this is the class section
<<<
// Add an event
public function addEvent($eventTitle, $eventYear, $eventMonth, $eventDay, $eventLink) {
$this->events[$eventYear][$eventMonth][$eventDay] = array( 'event_title' => $eventTitle, 'event_link' => $eventLink);
}
So how could I transform this line 28 to accept a date variable instead of hard coded date?
// this hard coded format works
$cal->addEvent('example Event 2', 2007, 12, 3, '
// trying to make the date a variable (here is today)
//For test purpose I broke the requested date format in three pieces
// Add event on current day
$b = date("Y").',';
$c = date("m").',';
$d = date("d").',';
$a=$b.$c.$d;
// this is line 28
$cal->addEvent('example Event', $a, ' //echo" $a";
// if I echo the result as $a, then the format is the good one
but some errors comes from the class as follow:
<<<
Warning: Missing argument 4 for calendar::addEvent(),
called in C:\ xxxxx on line 28 and defined in C:\xxxxx cal.class.php on line 155
AND
Warning: Missing argument 5 for calendar::addEvent(),
called in C:\xxxxx on line 28 and defined in C:xxxx cal.class.php on line 155
// this is the class section
<<<
// Add an event
public function addEvent($eventTitle, $eventYear, $eventMonth, $eventDay, $eventLink) {
$this->events[$eventYear][$eventMonth][$eventDay] = array( 'event_title' => $eventTitle, 'event_link' => $eventLink);
}
So how could I transform this line 28 to accept a date variable instead of hard coded date?