title: Can't get next/previous links working for CodeIgniter 2 Calendar class
body: <p><strong>Quoting this:</strong>  <a href="http://ellislab.com/codeigniter/user-guide/libraries/calendar.html" rel="nofollow">http://ellislab.com/codeigniter/user-guide/libraries/calendar.html</a></p>
  
  <blockquote>
    <p>To allow your calendar to dynamically increment/decrement via the
    next/previous links requires that you set up your calendar code
    similar to this example:</p>
  </blockquote>
  
  <pre><code>$prefs = array (
      'show_next_prev'  =&gt; TRUE,
      'next_prev_url'   =&gt; 'http://example.com/index.php/calendar/show/'
  );
  
  $this-&gt;load-&gt;library('calendar', $prefs);
  
  echo $this-&gt;calendar-&gt;generate($this-&gt;uri-&gt;segment(3), $this-&gt;uri-&gt;segment(4));
  </code></pre>
  
  <blockquote>
    <p>You'll notice a few things about the above example:</p>
    
    <ul>
    <li>You must set the "show_next_prev" to TRUE.</li>
    <li>You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.</li>
    <li>You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar
    class automatically adds the year/month to the base URL you provide.).</li>
    </ul>
  </blockquote>
  
  <p>The above is the sum total of what the CodeIgniter 2 documentation says about how to generate the "next/previous" links on the calendar.</p>
  
  <hr>
  
  <p>Here is how I've attempted to implement this.</p>
  
  <p>In my <code>events.php</code> Controller file:</p>
  
  <pre><code>public function calendar()
  {
      $prefs = array (
          'month_type'    =&gt; 'long',
          'day_type'      =&gt; 'short',
          'show_next_prev'=&gt; TRUE,
          'next_prev_url' =&gt; 'http://mydomain.com/events/calendar/'
      );
      $this-&gt;load-&gt;library('calendar', $prefs);
      echo $this-&gt;calendar-&gt;generate($this-&gt;uri-&gt;segment(3), $this-&gt;uri-&gt;segment(4));
  }
  </code></pre>
  
  <p>And in my <code>routes.php</code> file:</p>
  
  <pre><code>$route['events/calendar'] = 'events/calendar';
  </code></pre>
  
  <p>When I go to <code>/events/calendar/</code>, I see a calendar for the current month.</p>
  
  <p>However, when I click on the <code>next</code> link, I get taken to <code>/events/calendar/2013/04</code> as expected, but it's just a 404 page.</p>
  
  <p>I think the example in the documentation is making a big assumption that the reader should automatically know what else needs to be done here.  It's unclear whether the example is complete and supposed to work or if I'm supposed to know a critical piece is missing.  Am I supposed to create a function called <code>show()</code>?  Or am I supposed to pass the URL segments back into my original <code>calendar()</code> function somehow and do something else with them in there?  Routes?  I'm not sure what.</p>
  
  <p>Can anyone shed some light on this?  Please be as detailed as possible.  Thank-you.</p>