[eluser]TheFuzzy0ne[/eluser]
Here my way of doing it. It doesn't require any extending of the class, it's all done through a little bit of CSS and a template. You're welcome to export it into a function if you want to re-use the code.
./system/application/controllers/cal.php
Code:
<?php
class Cal extends Controller
{
function Cal()
{
parent::Controller();
}
function index()
{
$this->load->library('calendar');
$template = $this->calendar->default_template();
$config['template'] = '
{table_open}<table class="calendar" border="0" cellpadding="0" cellspacing="0">{/table_open}
{heading_row_start}<tr>{/heading_row_start}
{heading_previous_cell}<th><a href="{previous_url}"><<</a></th>{/heading_previous_cell}
{heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
{heading_next_cell}<th><a href="{next_url}">>></a></th>{/heading_next_cell}
{heading_row_end}</tr>{/heading_row_end}
{week_row_start}<tr>{/week_row_start}
{week_day_cell}<td>{week_day}</td>{/week_day_cell}
{week_row_end}</tr>{/week_row_end}
{cal_row_start}<tr>{/cal_row_start}
{cal_cell_start}<td>{/cal_cell_start}
{cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content}
{cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today}
{cal_cell_no_content}{day}{/cal_cell_no_content}
{cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}
{cal_cell_blank} {/cal_cell_blank}
{cal_cell_end}</td>{/cal_cell_end}
{cal_row_end}</tr>{/cal_row_end}
{table_close}</table>{/table_close}
';
$this->calendar->initialize($config);
$this->load->vars(array(
'cal1' => $this->calendar->generate(2009, 5, 13),
'cal2' => $this->calendar->generate(2009, 6)
));
$this->load->view('cal');
}
}
./system/application/views/cal.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Double Calendar</title>
<style type="text/css">
table.calendar {
float: left;
margin: 3px;
}
table.calendar td {
padding: 3px;
}
</style>
</head>
<body>
<div>
<?php echo $cal1; ?>
<?php echo $cal2; ?>
</div>
<div>
<!-- Add your next and prev links here -->
</div>
</body>
</html>
It needs a bit of tweaking as I don't know what you wanted it to look like, but hopefully, that shouldn't be too difficult.