Welcome Guest, Not a member yet? Register   Sign In
Really simple question: How to use calendar on home controller?
#1

[eluser]victorche[/eluser]
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:
http://example.com/2011/03
And I want there the same index (welcome controller), only with the new month displayed.
And I am doing it like this:
Code:
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?


Messages In This Thread
Really simple question: How to use calendar on home controller? - by El Forum - 02-23-2011, 02:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB