-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
42 lines (35 loc) · 1.15 KB
/
config.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
<?php
// url路由配置
Router::init(array(
'URL_MODE' => 1,
'VAR_CONTROLLER' => '',
'VAR_ACTION' => '',
'VAR_MODULE' => ''
));
// 解析url
$url_param = Router::makeUrl();
// 拼装模版路径
$url_path = '';
if ( !empty( $url_param['module'] ) ){
if( !empty( $url_param['controller']) ){
$url_path = './includes/'.$url_param['module'].'/'.$url_param['controller'].'.php';
} else {
$url_path = './includes/'.$url_param['module'].'.php';
}
}
// 页面单独需求css
$page_css = '';
// 页面单独需求js
$page_script = '';
/* 'module-controller'结构在css和js匹配中优先,其次'module' */
if ( file_exists('./css/'.$url_param['module'].'-'.$url_param['controller'].'.css') ){
$page_css = '/css/'.$url_param['module'].'-'.$url_param['controller'].'.css';
} if ( file_exists('./css/'.$url_param['module'].'.css') ){
$page_css = '/css/'.$url_param['module'].'.css';
}
if ( file_exists('./js/'.$url_param['module'].'-'.$url_param['controller'].'.js') ){
$page_script = '/js/'.$url_param['module'].'-'.$url_param['controller'].'.js';
} elseif ( file_exists('./js/'.$url_param['module'].'.js') ){
$page_script = '/js/'.$url_param['module'].'.js';
}
?>