Search code examples
phptwitter-bootstrapcodeignitercodeigniter-routing

how to load my default controller in codeigniter using bootstrap?


i have a view with bootstrap template which is embedded at my view/reportlist.php (localhost/Project/index.php). the problem is that every time i perform a CRUD, well codeigniter reroutes me to deffirent uri. example, when i edit a report from my list, i will be redirected to my view/reportlist.php (/Project/index.php/report/edit). then my bootstrap template is ruined. i need to go back to the /Project/index.php to load back everything up. please if you know, post some ideas, ive been like this for days now, i cant find a relevant answer.


Solution

  • there is no relation between codeigniter route and bootstrap. you can set you default controller in line 41 in: application > config > route.php file.

    on ther other hand you can set you base_url in line 17 in: application > config > config.php by this:

    $config['base_url'] = "http://".$_SERVER['HTTP_HOST'];
    $config['base_url'] .= preg_replace('@/+$@','',dirname($_SERVER['SCRIPT_NAME'])).'/'; 
    

    I'm sure that you have call again the list view in you edit method in report controller :D . if you want to avoid index.php from you url then you can modify code in your .htdocs files: