Routes OR statement?

I have a long routes-file. Often it contains the same action. Is there a way to use OR in the statement?

c::set('routes', array(
array(
    'pattern' => 'blog/(:any)',
    'action'  => function($uid) {
            go($uid);
    }
),
array(
    'pattern' => 'events/(:any)',
    'action'  => function($uid) {
            go($uid);
    }
));

Maybe something like this?

array(
    'pattern' => 'blog/(:any),events/(:any)',
    'action'  => function($uid) {
            go($uid);
    }
)

I think I’ve seen that you can use an array as the pattern argument:

array(
    'pattern' => array('blog/(:any)', 'events/(:any)'),
    'action'  => function($uid) {
            go($uid);
    }
)
1 Like

From looking at the toolkit’s router.php it looks as though your two options are to have an array as your pattern, or to use regex. Both should work.

1 Like

Ahh, thats too simple! It worked. Thanks!