Short story is that I'm fairly competent with PHP up to classes. I just never took things that far. Recently I keep bumping into the need to modify existing classes. This time, I'm really stuck.
I've successfully passed arrays to this class using this:
$calendar->highlighted_dates = $school_days_array;
But now I want to pass a new array and I'd like to modify the class in two ways.
First, I need to dynamically add more lines like this:
var $highlighted_dates1;
var $default_highlighted_class1 = 'highlighted1';
I'd like to add pairs of the lines above by looping through an array that contains values like this:
Array ( [0] => 1, [1] => 3, [2] => 7 )
The digit at the end of the var's above must come from the array. Note that the values are not sequential.
Secondly, I'd like to use the same array to loop through the following:
if( is_array($this->highlighted_dates1) ){
if( in_array($day_date, $this->highlighted_dates1) ){
$classes[] = $this->default_highlighted_class1;
}
}
Again, the digits at the end of the variables (is that what they're called in this case?) must come from the above array.
I don't expect anyone to hand feed me the answer, but I will need a really good shove in the right direction. I'm afraid a nudge won't be sufficient.
Thanks!