![]() |
Calendar class - link every non-content day - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Calendar class - link every non-content day (/showthread.php?tid=43092) |
Calendar class - link every non-content day - El Forum - 06-29-2011 [eluser]Kenneth Allen[/eluser] The existing Calendar class in CI is pretty good, but I am missing one feature — how to specify a link to appear in every non-content date cell which has the current date embedded. I have hacked the calendar class to embed the link as follows: Code: $kenSpecial = anchor(site_url('group/availableStandard/'.$year.'-'.$month.'-'.$day), 'Standard').' '.$day; That worked, but it restricts the class to this one special use (OK for the moment). I would prefer to pass in the URL with [current_date] for implicit substitution, or place it in the template for this use and still be able to use [current_date]. In fact, I think I am going to test the template approach and if that works use it, as the change to the Calendar class will then be more generic (just use a different template) If anyone have a better idea aside from changing line 227 in Calendar class from Code: $out .= str_replace('{day}', $day, $temp); Code: $out .= str_replace('{day}', $day, str_replace('[currrent_date]', $year.'-'$month.'-'$day$temp); |