Skip to content

Commit

Permalink
New feature : Allow to use own default controller and add new routes …
Browse files Browse the repository at this point in the history
…in config.php

Dev: Fix defaultController only if needed
Dev: Add '<_controller:\w+>/<_action:\w+>' after config.php routes (maybe move some other here too)
  • Loading branch information
Shnoulle committed Oct 21, 2014
1 parent 9cc8cdd commit b74d0f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions application/config/internal.php
Expand Up @@ -80,7 +80,12 @@
/**
* Some workarounds for erroneous settings in user config.php.
*/
$result['defaultController'] = $internalConfig['defaultController'];
$result['defaultController']=($result['defaultController']=='survey') ? $internalConfig['defaultController'] : $result['defaultController'];
/**
* Allways add needed routes at end
*/
$result['components']['urlManager']['rules']['<_controller:\w+>/<_action:\w+>']='<_controller>/<_action>';

return $result;
/* End of file internal.php */
/* Location: ./application/config/internal.php */
/* Location: ./application/config/internal.php */
2 changes: 0 additions & 2 deletions application/config/routes.php
Expand Up @@ -38,6 +38,4 @@
$route['optin/tokens/<surveyid:\d+>'] = array('optin/tokens','matchValue'=>true);
$route['statistics_user/<surveyid:\d+>'] = array('statistics_user/action','matchValue'=>true);

$route['<_controller:\w+>/<_action:\w+>'] = '<_controller>/<_action>';

return $route;

0 comments on commit b74d0f6

Please sign in to comment.