PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/halogy/application/config/routes.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 98 lines | 40 code | 10 blank | 48 comment | 8 complexity | 8abe97a2d354bae824740ba22c4a2ebb MD5 | raw file
 1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 2/*
 3| -------------------------------------------------------------------------
 4| URI ROUTING
 5| -------------------------------------------------------------------------
 6| This file lets you re-map URI requests to specific controller functions.
 7|
 8| Typically there is a one-to-one relationship between a URL string
 9| and its corresponding controller class/method. The segments in a
10| URL normally follow this pattern:
11|
12| 	example.com/class/method/id/
13|
14| In some instances, however, you may want to remap this relationship
15| so that a different class/function is called than the one
16| corresponding to the URL.
17|
18| Please see the user guide for complete details:
19|
20|	http://codeigniter.com/user_guide/general/routing.html
21|
22| -------------------------------------------------------------------------
23| RESERVED ROUTES
24| -------------------------------------------------------------------------
25|
26| There are two reserved routes:
27|
28|	$route['default_controller'] = 'welcome';
29|
30| This route indicates which controller class should be loaded if the
31| URI contains no data. In the above example, the "welcome" class
32| would be loaded.
33|
34|	$route['scaffolding_trigger'] = 'scaffolding';
35|
36| This route lets you set a "secret" word that will trigger the
37| scaffolding feature for added security. Note: Scaffolding must be
38| enabled in the controller in which you intend to use it.   The reserved 
39| routes must come before any wildcard or regular expression routes.
40|
41*/
42
43// assets
44$route['images/(:any)/(:any)/(:any)'] = 'pages/files/images/$3';
45$route['images/(:any)/(:any)'] = 'pages/files/images/$2';
46$route['images/(:any)'] = 'pages/files/images/$1';
47$route['gfx/(:any)/(:any)/(:any)'] = 'pages/files/gfx/$3';
48$route['gfx/(:any)/(:any)'] = 'pages/files/gfx/$2';
49$route['gfx/(:any)'] = 'pages/files/gfx/$1';
50$route['css/(:any)/(:any)/(:any)'] = 'pages/files/css/$3';
51$route['css/(:any)/(:any)'] = 'pages/files/css/$2';
52$route['css/(:any)'] = 'pages/files/css/$1';
53$route['js/(:any)/(:any)/(:any)'] = 'pages/files/js/$3';
54$route['js/(:any)/(:any)'] = 'pages/files/js/$2';
55$route['js/(:any)'] = 'pages/files/js/$1';
56
57// admin and modules
58$handle = opendir(APPPATH.'modules');
59if ($handle)
60{
61	while ( false !== ($module = readdir($handle)) )
62	{
63		// make sure we don't map silly dirs like .svn, or . or ..
64		
65		if (substr($module, 0, 1) != ".")
66		{
67			if ( file_exists(APPPATH.'modules/'.$module.'/'.$module.'_routes.php') )
68			{
69				include(APPPATH.'modules/'.$module.'/'.$module.'_routes.php');
70			}
71
72			if ( file_exists(APPPATH.'modules/'.$module.'/controllers/admin.php') )
73			{
74				$route['admin/'.$module] = $module.'/admin';
75				$route['admin/'.$module.'/(.*)'] = $module.'/admin/$1';
76			}
77
78			if ( file_exists(APPPATH.'modules/'.$module.'/controllers/'.$module.'.php') )
79			{
80				$route[$module] = $module;
81				$route[$module.'/(.*)'] = $module.'/$1';
82			}
83		}
84	}
85}
86
87// defaults
88$route['default_controller'] = 'pages';
89$route['scaffolding_trigger'] = 'scaf';
90
91// cms
92$route['(.*)'] = 'pages/index/$1';
93
94//print_r($route);
95
96
97/* End of file routes.php */
98/* Location: ./system/application/config/routes.php */