[eluser]Unknown[/eluser]
Good day,
I recently jumped on the wagon of using CodeIgniter and have so far enjoyed the simplicity and ease of use, but has come to an halt and probably due to lack of knowledge on what to search for I am coming up empty with a solution.
On the project I am currently working on I have a controller called Page, which is handling all requests at the moment and using the uri segments to determine the view and a function for the view. All this is working great as intended. To get to this, I have used the following configuration in routes.php
Code:
$route['default_controller'] = "page";
$route['(.*)'] = 'page';
$route['404_override'] = '';
Now I want to create a second controller to handle Ajax requests. My folder structure looks something as follow:
Code:
+ application
+ controllers
- ajax.php
- page.php
+ views
+ ajax
- test.php
- default.php
I am able to easily create additional views either in the views directory or sub directories. But with the above routes.php config as you would know the page controller will be used. Changing the config.php to the following one would assume it would override the route for the specific sub-folder, but it doesn't seem to.
Code:
$route['default_controller'] = "page";
$route['(.*)'] = 'page';
$route['(./ajax/*)'] = 'ajax';
$route['404_override'] = '';
Any advice towards a solution would be appreciated.
Thanks