Welcome Guest, Not a member yet? Register   Sign In
Can I Route YYYY/MM/DD URL Segments to a Controller?
#3

[eluser]kirkaracha[/eluser]
This worked, thanks!

Routes:
Code:
$route['(:num)/(:num)/(:num)'] = 'timeline/day/$1/$2/$3';
$route['(:num)/(:num)'] = 'timeline/month/$1/$2';
$route['(:num)'] = 'timeline/year/$1/';

Controller:

Code:
public function year() {
    $data = array(
        'message_text' => 'year'
    );
    $this->layouts->view('shared/display_messages',$data);
} // year

public function month() {
    $data = array(
        'message_text' => 'month'
    );
    $this->layouts->view('shared/display_messages',$data);
} // month

public function day() {
    $data = array(
        'message_text' => 'day'
    );
    $this->layouts->view('shared/display_messages',$data);
} // day


Messages In This Thread
Can I Route YYYY/MM/DD URL Segments to a Controller? - by El Forum - 04-14-2011, 09:05 PM
Can I Route YYYY/MM/DD URL Segments to a Controller? - by El Forum - 04-14-2011, 09:57 PM
Can I Route YYYY/MM/DD URL Segments to a Controller? - by El Forum - 04-14-2011, 10:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB