How to removing CI controller name - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to removing CI controller name (/showthread.php?tid=52776) |
How to removing CI controller name - El Forum - 06-26-2012 [eluser]Unknown[/eluser] Hi Everyone. I have a problem with CI routing. I have a login form (welcome/login) the controller function controlling the input post datas and value of result the controllers show the views. When i write wrong data into input fileds the controller showing the registration_view otherwise it show the succes_view. My problem is the following : Before submit the path of Js,CSS file is these Code: http://localhost/rememberme/application/views/js/js_base/css/redmond/jquery-ui-1.8.20.custom.css In this case the path of css,js is extends with the controller name "welcome" Code: http://localhost/rememberme/welcome/application/views/js/js_base/css/redmond/jquery-ui-1.8.20.custom.css How to removing CI controller name - El Forum - 06-26-2012 [eluser]marcogmonteiro[/eluser] 1st you should not have assets inside your views folder. So you need to create a folder in your root called assets or public and all those js and css files should be inside that folder. Then you can just load those assets like this: Code: <link href=<?= base_url('assets/css/css_file.css') ?>' rel='stylesheet' type='text/css'> How to removing CI controller name - El Forum - 06-26-2012 [eluser]Unknown[/eluser] Thank you it's work |