Welcome Guest, Not a member yet? Register   Sign In
Calendaring class
#6

[eluser]Drinian[/eluser]
Check if you initialized the class in your controller:
Code:
$this->load->library('calendar');
If you want to set preferences they must be passed during the load, not during the 'generate' function (like the docs say in one place):
Code:
$prefs = array (
               'start_day'    => 'saturday',
               'month_type'   => 'long',
               'day_type'     => 'short'
             );

$this->load->library('calendar', $prefs);
Then to see the calendar you echo the generate function:
Code:
echo $this->calendar->generate();
To show the next/prev links you set the prefs for that:
Code:
$prefs = array (
               'show_next_prev'  => TRUE,
               'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
             );
$this->load->library('calendar', $prefs);
echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
The above code has 'show' as the function in the controller. My problem was that I thought if I used 'index' I wouldn't have to explicitly list that in the next_prev_url but you do have to put it.

Hope that helps.


Messages In This Thread
Calendaring class - by El Forum - 08-06-2007, 01:40 PM
Calendaring class - by El Forum - 08-06-2007, 06:31 PM
Calendaring class - by El Forum - 08-06-2007, 07:27 PM
Calendaring class - by El Forum - 08-06-2007, 07:31 PM
Calendaring class - by El Forum - 09-11-2007, 10:33 PM
Calendaring class - by El Forum - 09-12-2007, 06:16 AM
Calendaring class - by El Forum - 04-24-2008, 05:41 AM
Calendaring class - by El Forum - 04-24-2008, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB