CodeIgniter Forums
Absolute path in making templates - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Absolute path in making templates (/thread-45876.html)



Absolute path in making templates - El Forum - 10-10-2011

[eluser]Unknown[/eluser]
Hi. Recently I decided to make a Template system for my CMS. As CodeIgniter is URL friendly default, I should pass every URL to my main page as absolute path. Everything is doing well but there is a problem that I faced it yesterday. If I want to make template system I should separate each template in a folder with their styles, images and etc. I did it myself with PHP with an include it's easy not tough. But as CI is in a MVC mode I should get each View and then use it, now I stored my templates In views folder and I get the main page. Therefore because everything is in views I cannot access the images, styles or anything else in that folder while My page is loaded because I loaded it by View in my Controller.

The only solution that I found is putting image and others in the root folder which is next to the application and system folder. I want to path them as where they really are (Template Folder).

Thanks! sorry for writing too much.