Welcome Guest, Not a member yet? Register   Sign In
The style sheet for a view page can't be separated in an Includes folder?
#21

[eluser]TWP Marketing[/eluser]
Quote:...
I tried the idea (which is a good one) of including this

Code:
<link rel="stylesheet" href="<?php echo base_url() ?>assets/style.css" type="text/css" />

but then the page went blank, it took me to I don't know where. I haven't modified the config file, so the base url is up to CI to guess.

Check your config and set your base_url
#22

[eluser]alvaroeesti[/eluser]


did this


$config['base_url'] = 'localhost/ci/';


this is my stuff from the URL box at the browser

http://localhost/CI/index.php/welcome/index/

#23

[eluser]TWP Marketing[/eluser]
[quote author="alvaroeesti" date="1343160206"]

did this


$config['base_url'] = 'localhost/ci/';


this is my stuff from the URL box at the browser

http://localhost/CI/index.php/welcome/index/

[/quote]

Does it work?
#24

[eluser]alvaroeesti[/eluser]


:/

this is the longest thread I have ever had in my life, I really thank you for all the tremendous patience that you are having, but why would it not work ?

I created the folder which is at the same level as the application, the system and user guide, as I said. Then inside the views is the header.php In his <HEAD> section I have the links.

Even without having to worry about base urls or things like that, it should just import it. The question is:

are we sure that the path:

Code:
@import url('css/style.css');</style>

really makes a header.php located as I said, inside the views folder, import a css file located at another folder called css which is located at the same level of depth with regards to root as the application, system and user guide?

#25

[eluser]CroNiX[/eluser]
Your web browser doesn't know or care about where your webserver is loading your header from. All the browser cares about is the final HTML output sent from the server.
#26

[eluser]CroNiX[/eluser]
It could be because you have:
Code:
$config['base_url'] = 'localhost/ci/';
with "ci" lower-cased, but according to your error message, the CI directory is capitalized, which matters on some OS's.

Also, base_url should start with "http://"
#27

[eluser]CroNiX[/eluser]
Quote:Fatal error: Call to undefined function base_url() in C:\xampp\htdocs\CI\application\views\header.html on line 8

Also, why do you have "header.html" in your views folder? There should only really be php files in there. I think you have more than one problem going on.
#28

[eluser]alvaroeesti[/eluser]


but in the views folder you can't have html files?
#29

[eluser]TWP Marketing[/eluser]
[quote author="alvaroeesti" date="1343161545"]

but in the views folder you can't have html files?[/quote]

If you plan on passing any variables to be displayed in the view file, it will need to be a .php file.
#30

[eluser]CroNiX[/eluser]
CI's loader won't load html files, either, which is CI's way to load view files.

Code:
$this->load->view('viewfile');
assumes viewfile is viewfile.php.




Theme © iAndrew 2016 - Forum software by © MyBB