forked from neilcrookes/CakePHP-Blog-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.php
69 lines (63 loc) · 1.27 KB
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Routes file for CakePHP Blog Plugin
*
* @author Neil Crookes <[email protected]>
* @link http://www.neilcrookes.com http://neil.crook.es
* @copyright (c) 2011 Neil Crookes
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
*/
Router::parseExtensions('rss');
Router::connect(
'/blog/:year/:month/*',
array(
'plugin' => 'blog',
'controller' => 'blog_posts',
'action' => 'index'
),
array(
'pass' => array('year', 'month'),
'year' => '2[0-9]{3}',
'month' => '0[1-9]|1[012]',
)
);
Router::connect(
'/blog/category/:category/*',
array(
'plugin' => 'blog',
'controller' => 'blog_posts',
'action' => 'index'
),
array(
'pass' => array('category'),
'category' => '[a-zA-Z0-9\-\_]+',
)
);
Router::connect(
'/blog/tag/:tag/*',
array(
'plugin' => 'blog',
'controller' => 'blog_posts',
'action' => 'index'
),
array(
'pass' => array('tag'),
'category' => '[a-zA-Z0-9\-\_]+',
)
);
Router::connect(
'/blog/:slug',
array(
'plugin' => 'blog',
'controller' => 'blog_posts',
'action' => 'view'
),
array(
'slug' => '[a-zA-Z0-9\-\_]+',
)
);
Router::connect('/blog/*', array(
'plugin' => 'blog',
'controller' => 'blog_posts',
'action' => 'index',
));