CodeIgniter Forums
Point a folder in the Views - 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: Point a folder in the Views (/showthread.php?tid=38076)



Point a folder in the Views - El Forum - 01-29-2011

[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!


Point a folder in the Views - El Forum - 01-30-2011

[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" />


Point a folder in the Views - El Forum - 01-30-2011

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

Any ideas?


Point a folder in the Views - El Forum - 01-30-2011

[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” />


Point a folder in the Views - El Forum - 01-30-2011

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

If you remove it, it'working !


Point a folder in the Views - El Forum - 01-30-2011

[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.


Point a folder in the Views - El Forum - 01-30-2011

[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


Point a folder in the Views - El Forum - 01-30-2011

[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