[eluser]pedsa[/eluser]
[quote author="WanWizard" date="1338218328"]Or simply are a route for ":any" that routes to 'front/index', and use the URI class to determine what segments are present and which data to fetch from the database.[/quote]
Thank you.
Here's the solution like you said:
In application/config/routes.php
Code:
$route['default_controller'] = "front_controller";
$route['(:any)'] = $route['default_controller'];
In application/controllers/front_controller.php
Code:
class Front_controller extends CI_Controller {
public function index() {
$argv = $this->uri->segment_array();
$argc = count($argv);
echo "<br>Number of segments = ".$argc;
echo "<pre>";
print_r($argv);
}
}
This approach certainly will slow down the page speed, but, in my opinion, it will increase the application flexibility. Do you know any other more effective way to handle this approach in CodeIgniter?