Welcome Guest, Not a member yet? Register   Sign In
Help using Calendar class
#1

[eluser]ReyPM[/eluser]
Hi, Iḿ trying to use Calendar but can't get to work the Previous, Next links. This is my code:
Code:
public function __construct() {
   $cal_prefs = array('show_next_prev' => TRUE, 'next_prev_url' => site_url('event'));
   $this->load->library('calendar', $cal_prefs);
}

public function index() {
  if ($this->uri->segment(2)) {
            $year = $this->uri->segment(2);
  } else {
            $year = "";
  }

  if($this->uri->segment(3)) {
            $month = $this->uri->segment(3);
  } else {
            $month = null;
  }

  echo $this->calendar->generate($year, $month);
}
If I show the calendar with no year or month all is fine but if I move one month after or before I get a blank page, what I'm doing wrong?




Theme © iAndrew 2016 - Forum software by © MyBB