Really simple question: How to use calendar on home controller?

Let me explain ... I want to have a calendar on the index page, in my case, this is the welcome controller. And I want this calendar to have prev/next month links. When I click on the next month for example, I want the url to be:
And I want there the same index (welcome controller), only with the new month displayed.
And I am doing it like this:
function index($year = NULL, $month = NULL)
    $prefs = array(
    'start_day' => 'monday',
    'show_next_prev' => TRUE,
    'next_prev_url' => base_url()
    $this->load->library('calendar', $prefs);
    $calendar = $this->calendar->generate($year, $month);

    $data = array(
        'calendar' => $calendar
Simple, isn't it?
Anyway, I am using CI without index.php in the urls. I mean, it is removed in the config and it is removed also with .htaccess.
But this simple thing is not working... When I click on the prev/next month, it gives me 404 error.
I tried with the routes option, but again no success.
Any ideas?

[eluser]Cristian Gilè[/eluser]
is not a valid URL. 2011 and 03 are two parameters. Controller name and method name are missing.

This is a valid URL:

Cristian Gilè

Yes, I know this ... but the strange thing is ... even if I add /welcome/index/ in the url, it still says "Error 404". And I thought, I can fix this somehow with the routes, but no success Sad

my mistake! it works! So the question is ... how can i fix this with the routes ... ?

[eluser]Cristian Gilè[/eluser]
$route['(:num)/(:num)'] = 'welcome/index/$1/$2';

Cristian Gilè

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.