-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathroutes.php
More file actions
47 lines (43 loc) · 1.16 KB
/
routes.php
File metadata and controls
47 lines (43 loc) · 1.16 KB
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
<?php
/**
* Questionnaires routes configuration
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
App::uses('Current', 'NetCommons.Utility');
$params = array(
'plugin' => 'questionnaires',
'controller' => 'questionnaire_edit'
);
$options = array(
'block_id' => '[0-9]+',
'key' => '[a-zA-Z0-9_]+', //_は、UnitTestで使用するため
);
if (Current::isSettingMode()) {
Router::connect(
'/' . Current::SETTING_MODE_WORD .
'/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/:key/*',
$params,
$options
);
Router::connect(
'/' . Current::SETTING_MODE_WORD .
'/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/*',
$params,
$options
);
}
Router::connect(
'/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/:key/*',
$params,
$options
);
Router::connect(
'/' . $params['plugin'] . '/' . $params['controller'] . '/:action/:block_id/*',
$params,
$options
);