Welcome Guest, Not a member yet? Register   Sign In
How to removing CI controller name
#1

[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
After submit the path of Js,CSS file is these, and the browser can't find it
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
#2

[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'>
#3

[eluser]Unknown[/eluser]
Thank you it's work Smile




Theme © iAndrew 2016 - Forum software by © MyBB