Welcome Guest, Not a member yet? Register   Sign In
Point a folder in the Views
#1

[eluser]Ludovic-r[/eluser]
Hi everyone!

I've recently migred CI 2.0 and developing a small CMS on it.

I just have one problem :

I need folders (css, js, images) in the Views folder and call it in my header.php file like :

Code:
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/styles.css" type="text/css" media="screen" charset="utf-8" />

I had this folder in the root of CI folder and it worked very well but I no longer need this because I need to have my CSS folder within my Theme folder (placed in the Views folder). I've try Asset helper from Phil Sturgeon but I doesn't work for my needs.

Any ideas would be very very appreciated!

Thanks!
#2

[eluser]ludovic[/eluser]
Perhaps try to go in you'r views folder

<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>application/views/css/styles.css" type="text/css" media="screen" charset="utf-8" />
#3

[eluser]Ludovic-r[/eluser]
Thanks for your answer but it doesn't work, The url is 403 forbidden.

Any ideas?
#4

[eluser]ludovic[/eluser]
403 Forbidden it's a probleme of permission ?
Have you got the good permisions for your folder and file ? 755 for exemple.

Perhaps it's because you forget http:// on your base_url().

<link rel=“stylesheet” type=“text/css” href=”http://<?php echo base_url();?>application/views/css/styles.css” type=“text/css” media=“screen” charset=“utf-8” />
#5

[eluser]ludovic[/eluser]
It's the .htaccess in application folder
you have Deny from all

If you remove it, it'working !
#6

[eluser]Ludovic-r[/eluser]
I have no .htaccess in my app folder maybe because I work locally, I think I'll create one with permissions but I would like to do another solution than htaccess. More cleaner.
#7

[eluser]ludovic[/eluser]
If you migred to CI 2.0 you have necessarily a .htaccess file in folder application
Inside the file you can read Deny from all

That why you have 403 Forbidden
#8

[eluser]Ludovic-r[/eluser]
Oh, apologize, I'm on a MAC and it hide the files automatically, on command on Terminal an it's okay! I'll try to modify the .htaccess




Theme © iAndrew 2016 - Forum software by © MyBB