CodeIgniter Forums
correct layout structure - 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: correct layout structure (/showthread.php?tid=42592)



correct layout structure - El Forum - 06-12-2011

[eluser]Uplift[/eluser]
What is the correct layout structure for views?

i can view my index.php fine, but when i go to something like index.php/blog/ or whatever then all links fail so i get no includes, css, or js.

/application/views/ (home page, etc..)
/application/view/includes/ (header, footer, sidebar, etc...)
/css/
/js/
index.php

afaik everything is relative to index.php

Would i need use full paths for linking everything? I was hoping to avoid this because at the moment i have code igniter in a temp directory before i go live i don't want to edit full site and remove it's directory prior to going live.


correct layout structure - El Forum - 06-12-2011

[eluser]InsiteFX[/eluser]
Create a assets folder in the root with index.php
Code:
/application/views/ (home page, etc..)
/application/view/includes/ (header, footer, sidebar, etc…)
assets
/css/
/js/
index.php

then when including your files use:
Code:
<link href="<?php echo base_url();?>assets/css/your_file.css" rel="stylesheet" type="text/css" />

InsiteFX